提交 fe5d9624 编写于 作者: O Ondrej Zary 提交者: John W. Linville

orinoco_usb: Fix broken firmware load error checking

The check of ezusb_firmware_download() return value (added by commit
488ec878) 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: NOndrej Zary <linux@rainbow-software.org>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 e515e9cb
...@@ -1687,7 +1687,7 @@ static int ezusb_probe(struct usb_interface *interface, ...@@ -1687,7 +1687,7 @@ static int ezusb_probe(struct usb_interface *interface,
firmware.code = fw_entry->data; firmware.code = fw_entry->data;
} }
if (firmware.size && firmware.code) { if (firmware.size && firmware.code) {
if (ezusb_firmware_download(upriv, &firmware)) if (ezusb_firmware_download(upriv, &firmware) < 0)
goto error; goto error;
} else { } else {
err("No firmware to download"); err("No firmware to download");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册