提交 4dfdc464 编写于 作者: J Jiri Kosina

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: NMarcin Tolysz <tolysz@gmail.com>
Signed-off-by: NJiri Kosina <jkosina@suse.cz>
上级 b8a832b1
...@@ -102,7 +102,7 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id) ...@@ -102,7 +102,7 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id)
} }
ret = sony_set_operational(hdev); ret = sony_set_operational(hdev);
if (ret) if (ret < 0)
goto err_stop; goto err_stop;
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册