Commit 5588d6a6 authored by Anton Vasilyev's avatar Anton Vasilyev Committed by Kleber Sacilotto de Souza

uwb: hwa-rc: fix memory leak at probe

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

[ Upstream commit 11b71782 ]

hwarc_probe() allocates memory for hwarc, but does not free it
if uwb_rc_add() or hwarc_get_version() fail.

Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: default avatarAnton Vasilyev <vasilyev@ispras.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent b93afa41
......@@ -875,6 +875,7 @@ static int hwarc_probe(struct usb_interface *iface,
error_rc_add:
usb_put_intf(iface);
usb_put_dev(hwarc->usb_dev);
kfree(hwarc);
error_alloc:
uwb_rc_put(uwb_rc);
error_rc_alloc:
......
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