aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
authorRosen Penev <rosenp@gmail.com>2026-05-18 17:48:34 -0700
committerTakashi Iwai <tiwai@suse.de>2026-05-19 08:03:37 +0200
commitcce8ec8209892b972c743d66180cbe64f19ba83d (patch)
tree41ca104b71236eabe9d22ab44654b7041c1519aa /sound
parent2c515c221a7a2fd0dcb335b9866a98d0bedd9ca5 (diff)
downloadlinux-next-history-cce8ec8209892b972c743d66180cbe64f19ba83d.tar.gz
ALSA: usb-audio: Use flexible allocation for FCP packets
Allocate FCP request and response packets with kmalloc_flex() for the trailing packet data instead of passing the computed struct size directly to kmalloc(). Keep the computed packet sizes for the USB transfer length checks. Assisted-by: Codex:GPT-5.5 Signed-off-by: Rosen Penev <rosenp@gmail.com> Link: https://patch.msgid.link/20260519004834.627676-1-rosenp@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/usb/fcp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/usb/fcp.c b/sound/usb/fcp.c
index 0fc4d063c48a5..ea746bdb36ffc 100644
--- a/sound/usb/fcp.c
+++ b/sound/usb/fcp.c
@@ -191,13 +191,13 @@ static int fcp_usb(struct usb_mixer_interface *mixer, u32 opcode,
struct fcp_usb_packet *req __free(kfree) = NULL;
size_t req_buf_size = struct_size(req, data, req_size);
- req = kmalloc(req_buf_size, GFP_KERNEL);
+ req = kmalloc_flex(*req, data, req_size);
if (!req)
return -ENOMEM;
struct fcp_usb_packet *resp __free(kfree) = NULL;
size_t resp_buf_size = struct_size(resp, data, resp_size);
- resp = kmalloc(resp_buf_size, GFP_KERNEL);
+ resp = kmalloc_flex(*resp, data, resp_size);
if (!resp)
return -ENOMEM;