Commit 6e6eae04 authored by Colin Ian King's avatar Colin Ian King Committed by Jiri Kosina

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: 4b2c53d9 ("SFH:Transport Driver to add support of AMD Sensor Fusion Hub (SFH)")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Reviewed-by: default avatarSandeep Singh <sandeep.singh@amd.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 907286d1
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment