mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
firewire: cdev: use kzalloc_flex() to allocate structure with byte array
Some event structures have a trailing flexible array member of bytes to store event-specific data. Use kzalloc_flex() to allocate the structure together with storage for the flexible array member. Link: https://lore.kernel.org/r/20260928125718.50974-4-o-takashi@sakamocchi.jp Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
This commit is contained in:
parent
b1790574d3
commit
8487a3a876
|
|
@ -1020,7 +1020,7 @@ static void iso_callback(struct fw_iso_context *context, u32 cycle,
|
|||
struct client *client = data;
|
||||
struct iso_interrupt_event *e;
|
||||
|
||||
e = kmalloc(sizeof(*e) + header_length, GFP_KERNEL);
|
||||
e = kzalloc_flex(*e, interrupt.header, header_length);
|
||||
if (e == NULL)
|
||||
return;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user