mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 04:18:39 +08:00
media: siano: Use flex arrays for sms_firmware
Replace old style single array member, with flex array. The struct is allocated, but it seems like there was an over allocation error: fw_buf = kmalloc(ALIGN(fw->size + sizeof(struct sms_firmware), SMS_ALLOC_ALIGNMENT), GFP_KERNEL | coredev->gfp_buf_flags); This change fixes this cocci warning: drivers/media/common/siano/smscoreapi.h:669:6-13: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
This commit is contained in:
parent
b657179a11
commit
364ae46413
@ -666,7 +666,7 @@ struct sms_firmware {
|
||||
u32 check_sum;
|
||||
u32 length;
|
||||
u32 start_address;
|
||||
u8 payload[1];
|
||||
u8 payload[];
|
||||
};
|
||||
|
||||
/* statistics information returned as response for
|
||||
|
Loading…
Reference in New Issue
Block a user