Skip to content

Commit 520e345

Browse files
gwendalcrTzung-Bi Shih
authored andcommitted
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: 9600b8b ("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>
1 parent d55493f commit 520e345

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

include/linux/platform_data/cros_ec_commands.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2028,7 +2028,7 @@ struct lightbar_program {
20282028
struct lightbar_program_ex {
20292029
uint8_t size;
20302030
uint16_t offset;
2031-
uint8_t data[0];
2031+
uint8_t data[];
20322032
} __ec_todo_packed;
20332033

20342034
struct ec_params_lightbar {

0 commit comments

Comments
 (0)