Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f87f3ea2 authored by Gidon Studinski's avatar Gidon Studinski
Browse files

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: default avatarGidon Studinski <gidons@codeaurora.org>
parent ae0fa522
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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) {