wigig_sensing: fix usage of wait_event_interruptible_timeout()

wait_event_interruptable_timeout() returns a positive number in a success
case. This positive number needs to be set to 0 so that the calling
function recognizes it as a success.

Change-Id: Ic8565f95976f98682334da84d950257d43d6a320
Signed-off-by: Gidon Studinski <gidons@codeaurora.org>
Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
This commit is contained in:
Gidon Studinski 2019-12-05 18:21:18 +02:00 • committed by Gerrit - the friendly Code Review server
commit c4c4c4f1e2

View file

@ -563,12 +563,14 @@ static int wigig_sensing_ioc_change_mode(struct wigig_sensing_ctx *ctx,
pr_err("wait_event_interruptible_timeout() interrupted by a signal (%d)\n",
rc);
goto End;
}
if (rc == 0) {
} else if (rc == 0) {
/* Timeout, FW did not respond in time */
pr_err("wait_event_interruptible_timeout() timed out\n");
rc = -ETIME;
goto End;
} else {
/* rc > 0, this is fine, set rc to 0 */
rc = 0;
}
if (ctx->stm.state != ctx->stm.state_request) {