Commit f8dba590 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Marcelo Henrique Cerri

usb: gadget: net2272: Fix a memory leak in an error handling path in 'net2272_plat_probe()'

BugLink: https://bugs.launchpad.net/bugs/1881356

commit ccaef7e6 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: 90fccb52 ("usb: gadget: Gadget directory cleanup - group UDC drivers")
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarIan May <ian.may@canonical.com>
Signed-off-by: default avatarKelsey Skunberg <kelsey.skunberg@canonical.com>
parent 79a80df2
......@@ -2670,6 +2670,8 @@ net2272_plat_probe(struct platform_device *pdev)
err_req:
release_mem_region(base, len);
err:
kfree(dev);
return ret;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment