History

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)

Gwendal Grignou committed 9 months ago

Commit 520e3451 parent d55493f1 file · +1 −1Browse files

Showing the changes to include/linux/platform_data (1 of 1 file). Show all

Unified · Split

include/linux/platform_data/cros_ec_commands.h+1−1
@@ -2028,7 +2028,7 @@ struct lightbar_program { · 2027 unmodified lines
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 {