Commit f5335e00 authored by Alexey Khoroshilov's avatar Alexey Khoroshilov Committed by John W. Linville

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: default avatarAlexey Khoroshilov <khoroshilov@ispras.ru>
Acked-by: default avatarChristian Lamparter <chunkeey@googlemail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 3e3cb6ca
...@@ -1053,6 +1053,10 @@ static int p54u_probe(struct usb_interface *intf, ...@@ -1053,6 +1053,10 @@ static int p54u_probe(struct usb_interface *intf,
priv->upload_fw = p54u_upload_firmware_net2280; priv->upload_fw = p54u_upload_firmware_net2280;
} }
err = p54u_load_firmware(dev, intf); err = p54u_load_firmware(dev, intf);
if (err) {
usb_put_dev(udev);
p54_free_common(dev);
}
return err; return err;
} }
......
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