]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob
e26f22421a7788ce0ce43e585a40c86abfe6796f
[thirdparty/kernel/stable-queue.git] /
1 From ccaef7e6e354fb65758eaddd3eae8065a8b3e295 Mon Sep 17 00:00:00 2001
2 From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
3 Date: Mon, 27 Apr 2020 20:04:23 +0200
4 Subject: usb: gadget: net2272: Fix a memory leak in an error handling path in 'net2272_plat_probe()'
5
6 From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
7
8 commit ccaef7e6e354fb65758eaddd3eae8065a8b3e295 upstream.
9
10 'dev' is allocated in 'net2272_probe_init()'. It must be freed in the error
11 handling path, as already done in the remove function (i.e.
12 'net2272_plat_remove()')
13
14 Fixes: 90fccb529d24 ("usb: gadget: Gadget directory cleanup - group UDC drivers")
15 Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
16 Signed-off-by: Felipe Balbi <balbi@kernel.org>
17 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
18
19 ---
20 drivers/usb/gadget/udc/net2272.c | 2 ++
21 1 file changed, 2 insertions(+)
22
23 --- a/drivers/usb/gadget/udc/net2272.c
24 +++ b/drivers/usb/gadget/udc/net2272.c
25 @@ -2653,6 +2653,8 @@ net2272_plat_probe(struct platform_devic
26 err_req:
27 release_mem_region(base, len);
28 err:
29 + kfree(dev);
30 +
31 return ret;
32 }
33