patch "usb: gadget: Fix memleak in gadgetfs_fill_super" added to usb-linus
Subsystems (2)
This is a note to let you know that I've just added the patch titled
usb: gadget: Fix memleak in gadgetfs_fill_super
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.
The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.
If you have any questions about this process, please let me know.
From 87bed3d7d26c974948a3d6e7176f304b2d41272b Mon Sep 17 00:00:00 2001
From: Zhang Qilong <[email protected]>
Date: Tue, 17 Nov 2020 10:16:29 +0800
Subject: usb: gadget: Fix memleak in gadgetfs_fill_super
usb_get_gadget_udc_name will alloc memory for CHIP in "Enomem" branch. we should free it before error returns to prevent memleak.
--- drivers/usb/gadget/legacy/inode.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/usb/gadget/legacy/inode.c +3 -0
@@ -2039,6 +2039,9 @@ gadgetfs_fill_super (struct super_block *sb, struct fs_context *fc)return 0 ; Enomem: +kfree (CHIP ); +CHIP =NULL ; +return -ENOMEM ; }
Signature · 1 line
2.29.2