From: Jiri Kosina Date: Mon, 29 Dec 2008 23:49:59 +0000 (+0100) Subject: HID: fix error condition propagation in hid-sony driver X-Git-Tag: v2.6.29-rc1~498^2^2 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=4dfdc46468a142216b284eea66040f49df3f7191;p=linux-block.git HID: fix error condition propagation in hid-sony driver 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 Signed-off-by: Jiri Kosina --- diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index 86e563b8d644..dd5a3979a4de 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c @@ -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;