From 520e345dfdab89aed4a0ad98d5ec35086661a11a Mon Sep 17 00:00:00 2001 From: Gwendal Grignou Date: Tue, 3 Feb 2026 19:48:48 -0800 Subject: [PATCH] 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: 9600b8bdbfe4 ("platform/chrome: lightbar: Add support for large sequence") Signed-off-by: Gwendal Grignou Link: https://lore.kernel.org/r/20260204034848.697033-1-gwendal@google.com Signed-off-by: Tzung-Bi Shih --- include/linux/platform_data/cros_ec_commands.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/platform_data/cros_ec_commands.h b/include/linux/platform_data/cros_ec_commands.h index bddc7568158e..8080a6fc6c8c 100644 --- a/include/linux/platform_data/cros_ec_commands.h +++ b/include/linux/platform_data/cros_ec_commands.h @@ -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 { -- 2.47.3