mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: syzbot <syzbot+87c10526d2cfa8d14ff6@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org
Subject: Forwarded: [PATCH] usb: gadget: f_uac2: Fix memory leak in srate parsing
Date: Sun, 02 Aug 2026 18:15:46 -0700	[thread overview]
Message-ID: <6a6febc2.d606a800.1705cf.000f.GAE@google.com> (raw)
In-Reply-To: <6a6f9b87.13bfb6d0.1ecdd5.0275.GAE@google.com>

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.

***

Subject: [PATCH] usb: gadget: f_uac2: Fix memory leak in srate parsing
Author: ryan.mehri1@gmail.com

#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git fc02acf6ac0c

Signed-off-by: Ryan Mehri <ryan.mehri1@gmail.com>
---
 drivers/usb/gadget/function/f_uac2.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c
index 897787d0803c..5d6701019e10 100644
--- a/drivers/usb/gadget/function/f_uac2.c
+++ b/drivers/usb/gadget/function/f_uac2.c
@@ -2013,6 +2013,7 @@ static ssize_t f_uac2_opts_##name##_store(struct config_item *item,	\
 {									\
 	struct f_uac2_opts *opts = to_f_uac2_opts(item);		\
 	char *split_page = NULL;					\
+	char *p = NULL;							\
 	int ret = -EINVAL;						\
 	char *token;							\
 	u32 num;							\
@@ -2026,8 +2027,8 @@ static ssize_t f_uac2_opts_##name##_store(struct config_item *item,	\
 									\
 	i = 0;								\
 	memset(opts->name##s, 0x00, sizeof(opts->name##s));		\
-	split_page = kstrdup(page, GFP_KERNEL);				\
-	while ((token = strsep(&split_page, ",")) != NULL) {		\
+	split_page = p = kstrdup(page, GFP_KERNEL);			\
+	while ((token = strsep(&p, ",")) != NULL) {			\
 		ret = kstrtou32(token, 0, &num);			\
 		if (ret)						\
 			goto end;					\
-- 
2.55.0


      reply	other threads:[~2026-08-03  1:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-02 19:33 [syzbot] [usb?] memory leak in f_uac2_opts_p_srate_store syzbot
2026-08-03  1:15 ` syzbot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6a6febc2.d606a800.1705cf.000f.GAE@google.com \
    --to=syzbot+87c10526d2cfa8d14ff6@syzkaller.appspotmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®