summaryrefslogtreecommitdiff
path: root/drivers/firewire
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2026-09-28 21:57:15 +0900
committerTakashi Sakamoto <o-takashi@sakamocchi.jp>2026-09-28 22:18:30 +0900
commit040ae6fe19ae619e8c0d2489ae100f9e434391ce (patch)
treee061bd6e7f95027f345c1159e74bd3b410de8a02 /drivers/firewire
parentadcc279ef832c40bfc1229a4d932dea0e5d2b8a5 (diff)
downloadlinux-next-040ae6fe19ae619e8c0d2489ae100f9e434391ce.tar.gz
linux-next-040ae6fe19ae619e8c0d2489ae100f9e434391ce.zip
firewire: core: use kzalloc_flex() to allocate structure with quadlet array
fw_core_handle_request() is now called in process context, so GFP_KERNEL is available. The fw_request structure has a trailing flexible array member of quadlets to store packet data. Use kzalloc_flex() to allocate the structure together with storage for the flexible array member. Link: https://lore.kernel.org/r/20260928125718.50974-2-o-takashi@sakamocchi.jp Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Diffstat (limited to 'drivers/firewire')
-rw-r--r--drivers/firewire/core-transaction.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.c
index 7450eb0ac3cd..b4fccabb8fb2 100644
--- a/drivers/firewire/core-transaction.c
+++ b/drivers/firewire/core-transaction.c
@@ -894,8 +894,8 @@ static struct fw_request *allocate_request(struct fw_card *card,
return NULL;
}
- request = kmalloc(sizeof(*request) + length, GFP_ATOMIC);
- if (request == NULL)
+ request = kzalloc_flex(*request, data, DIV_ROUND_UP(length, sizeof(u32)));
+ if (!request)
return NULL;
kref_init(&request->kref);