HID: fix error condition propagation in hid-sony driver
Jiri Kosina [Mon, 29 Dec 2008 23:49:59 +0000 (00:49 +0100)]
sony_set_operational() only propagates return value from
usb_control_msg(), which returns negative on error and number
of transferred bytes otherwise.

Reported-by: Marcin Tolysz <tolysz@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>

drivers/hid/hid-sony.c

index 86e563b..dd5a397 100644 (file)
@@ -102,7 +102,7 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id)
        }
 
        ret = sony_set_operational(hdev);
-       if (ret)
+       if (ret < 0)
                goto err_stop;
 
        return 0;