orinoco_usb: Fix broken firmware load error checking
authorOndrej Zary <linux@rainbow-software.org>
Fri, 9 May 2014 16:10:34 +0000 (18:10 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 13 May 2014 19:56:35 +0000 (15:56 -0400)
The check of ezusb_firmware_download() return value (added by commit
488ec878034eccb852267b0e27ce9d511f75c587) is broken because
ezusb_firmware_download() returns 1 on success.
This causes the driver not to work with the following error:
orinoco_usb: probe of 3-3:1.0 failed with error -14

Check the return value only for negative values.

This fix should be applied to -stable kernels too.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/orinoco/orinoco_usb.c

index f9805c9353d2295f076d1f5cbe1eaaa5a1f0be72..1cbb7835806f7c0d96315279c43dc34167bb180f 100644 (file)
@@ -1687,7 +1687,7 @@ static int ezusb_probe(struct usb_interface *interface,
                firmware.code = fw_entry->data;
        }
        if (firmware.size && firmware.code) {
-               if (ezusb_firmware_download(upriv, &firmware))
+               if (ezusb_firmware_download(upriv, &firmware) < 0)
                        goto error;
        } else {
                err("No firmware to download");