forked from Minki/linux
SFH: fix error return check for -ERESTARTSYS
Currently the check for the error return code -ERESTARTSYS is dead code
and never executed because a previous check for ret < 0 is catching this
and returning -ETIMEDOUT instead. Fix this by checking for -ERESTARTSYS
before the more generic negative error code.
Addresses-Coverity: ("Logically dead code")
Fixes: 4b2c53d93a
("SFH:Transport Driver to add support of AMD Sensor Fusion Hub (SFH)")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Sandeep Singh <sandeep.singh@amd.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
parent
907286d142
commit
6e6eae04f5
@ -88,10 +88,10 @@ static int amdtp_wait_for_response(struct hid_device *hid)
|
||||
ret = wait_event_interruptible_timeout(hid_data->hid_wait,
|
||||
cli_data->request_done[i],
|
||||
msecs_to_jiffies(AMD_SFH_RESPONSE_TIMEOUT));
|
||||
if (ret < 0)
|
||||
return -ETIMEDOUT;
|
||||
else if (ret == -ERESTARTSYS)
|
||||
if (ret == -ERESTARTSYS)
|
||||
return -ERESTARTSYS;
|
||||
else if (ret < 0)
|
||||
return -ETIMEDOUT;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user