summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/p54/p54usb.c
diff options
context:
space:
mode:
authorAlexey Khoroshilov <khoroshilov@ispras.ru>2014-03-08 01:11:49 +0400
committerJohn W. Linville <linville@tuxdriver.com>2014-03-14 22:49:13 +0400
commitf5335e00f30ef69f093e5074ecf8ef5e778baf3b (patch)
tree7bb578c09a10eb5865d983d1829e3a014eaf7b08 /drivers/net/wireless/p54/p54usb.c
parent3e3cb6caea8a86cebfafed349184c125d563cbc1 (diff)
downloadlinux-f5335e00f30ef69f093e5074ecf8ef5e778baf3b.tar.xz
p54usb: fix leaks at failure path in p54u_probe()
If p54u_load_firmware() fails, p54u_probe() does not deallocate already allocated resources. The patch adds proper failure handling. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Acked-by: Christian Lamparter <chunkeey@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/p54/p54usb.c')
-rw-r--r--drivers/net/wireless/p54/p54usb.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c
index b7ab3dfb3de8..043bd1c23c19 100644
--- a/drivers/net/wireless/p54/p54usb.c
+++ b/drivers/net/wireless/p54/p54usb.c
@@ -1053,6 +1053,10 @@ static int p54u_probe(struct usb_interface *intf,
priv->upload_fw = p54u_upload_firmware_net2280;
}
err = p54u_load_firmware(dev, intf);
+ if (err) {
+ usb_put_dev(udev);
+ p54_free_common(dev);
+ }
return err;
}