Skip to content

Commit

Permalink
p54usb: fix leaks at failure path in p54u_probe()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Christian Lamparter <[email protected]>
Signed-off-by: John W. Linville <[email protected]>
  • Loading branch information
khoroshilov authored and linvjw committed Mar 14, 2014
1 parent 3e3cb6c commit f5335e0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/net/wireless/p54/p54usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit f5335e0

Please sign in to comment.