p54usb: fix leak at failure path in p54u_load_firmware()
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Tue, 17 Sep 2013 20:57:59 +0000 (00:57 +0400)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 26 Sep 2013 18:02:29 +0000 (14:02 -0400)
If request_firmware_nowait() fails in p54u_load_firmware(),
p54u_load_firmware_cb is not called and no one decrements usb_dev refcnt.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/p54/p54usb.c

index b9deef66cf4b8179893b918fbd0fb3365480a686..7fa81d13b4e5fbc4d72bc9037229340789ec13b0 100644 (file)
@@ -979,6 +979,7 @@ static int p54u_load_firmware(struct ieee80211_hw *dev,
        if (err) {
                dev_err(&priv->udev->dev, "(p54usb) cannot load firmware %s "
                                          "(%d)!\n", p54u_fwlist[i].fw, err);
+               usb_put_dev(udev);
        }
 
        return err;