mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-03 13:37:00 -04:00
platform/chrome: lightbar: Use flexible array member
Variable arrays should be defined as [], not [0], otherwise
the kernel complains:
memcpy : detected field-spanning write (size 9) of single field "param->set_program_ex.data" at drivers/platform/chrome/cros_ec_lightbar.c:603 (size 0)
Fixes: 9600b8bdbf ("platform/chrome: lightbar: Add support for large sequence")
Signed-off-by: Gwendal Grignou <gwendal@google.com>
Link: https://lore.kernel.org/r/20260204034848.697033-1-gwendal@google.com
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
This commit is contained in:
committed by
Tzung-Bi Shih
parent
d55493f6d2
commit
520e345dfd
@@ -2028,7 +2028,7 @@ struct lightbar_program {
|
||||
struct lightbar_program_ex {
|
||||
uint8_t size;
|
||||
uint16_t offset;
|
||||
uint8_t data[0];
|
||||
uint8_t data[];
|
||||
} __ec_todo_packed;
|
||||
|
||||
struct ec_params_lightbar {
|
||||
|
||||
Reference in New Issue
Block a user