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

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
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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;
}