Skip to content

Commit

Permalink
HID: fix error condition propagation in hid-sony driver
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jiri Kosina committed Jan 4, 2009
1 parent b8a832b commit 4dfdc46
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/hid/hid-sony.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4dfdc46

Please sign in to comment.