diff options
author | Anton Vasilyev <vasilyev@ispras.ru> | 2018-07-06 15:32:53 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-10-03 17:00:46 -0700 |
commit | c1a630680c8b62c3f34f7041fcc10441c6bd5c22 (patch) | |
tree | 58ee8c2aca38194cbd68e01edd13fe4d3d0d880b | |
parent | 72bad20e9316bf6203def57256a5ade158585558 (diff) | |
download | linux-rt-c1a630680c8b62c3f34f7041fcc10441c6bd5c22.tar.gz |
uwb: hwa-rc: fix memory leak at probe
[ Upstream commit 11b71782c1d10d9bccc31825cf84291cd7588a1e ]
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: Anton Vasilyev <vasilyev@ispras.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/uwb/hwa-rc.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/uwb/hwa-rc.c b/drivers/uwb/hwa-rc.c index 9a53912bdfe9..5d3ba747ae17 100644 --- a/drivers/uwb/hwa-rc.c +++ b/drivers/uwb/hwa-rc.c @@ -873,6 +873,7 @@ error_get_version: 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: |