Re: [PATCH 1/1] input: usbhid: fix improper check

2016-12-05 Thread Oliver Neukum
On Sun, 2016-12-04 at 13:10 +0800, Pan Bian wrote: > From: Pan Bian > > Function hid_post_reset() returns 0 on success, or 1 on failures. It seems like hid_post_reset() is buggy in not returning a proper error code in the failure case. So your diagnosis is right, but the

Re: [PATCH 1/1] input: usbhid: fix improper check

2016-12-05 Thread Oliver Neukum
On Sun, 2016-12-04 at 13:10 +0800, Pan Bian wrote: > From: Pan Bian > > Function hid_post_reset() returns 0 on success, or 1 on failures. It seems like hid_post_reset() is buggy in not returning a proper error code in the failure case. So your diagnosis is right, but the fix is at the wrong

[PATCH 1/1] input: usbhid: fix improper check

2016-12-03 Thread Pan Bian
From: Pan Bian Function hid_post_reset() returns 0 on success, or 1 on failures. However, in function hid_reset_resume(), uses "status >= 0" to check the return value of hid_post_reset(). Obviously, the condition will always be satisfied. This patch fixes the bug, uses

[PATCH 1/1] input: usbhid: fix improper check

2016-12-03 Thread Pan Bian
From: Pan Bian Function hid_post_reset() returns 0 on success, or 1 on failures. However, in function hid_reset_resume(), uses "status >= 0" to check the return value of hid_post_reset(). Obviously, the condition will always be satisfied. This patch fixes the bug, uses "status == 0" to check the