]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
usb: gadget: net2272: Fix a memory leak in an error handling path in 'net2272_plat_pr...
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Mon, 27 Apr 2020 18:04:23 +0000 (20:04 +0200)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Mon, 22 Jun 2020 20:22:09 +0000 (17:22 -0300)
BugLink: https://bugs.launchpad.net/bugs/1879759
commit ccaef7e6e354fb65758eaddd3eae8065a8b3e295 upstream.

'dev' is allocated in 'net2272_probe_init()'. It must be freed in the error
handling path, as already done in the remove function (i.e.
'net2272_plat_remove()')

Fixes: 90fccb529d24 ("usb: gadget: Gadget directory cleanup - group UDC drivers")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/usb/gadget/udc/net2272.c

index 247de0faaeb7f22df485969648438d8cf601ec7b..5980540a8fff2237c76afe230f278b52ad701935 100644 (file)
@@ -2647,6 +2647,8 @@ net2272_plat_probe(struct platform_device *pdev)
  err_req:
        release_mem_region(base, len);
  err:
+       kfree(dev);
+
        return ret;
 }