Skip to content

Commit

Permalink
staging: vchiq_core: Don't BUG if process is unexpected
Browse files Browse the repository at this point in the history
Bail out properly if the process index doesn't match the remote insert.
We also drop the BUG in case the process index is at local insert,
so we can trigger the WARN_ON again some steps later.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Stefan Wahren authored and Greg Kroah-Hartman committed May 29, 2017
1 parent 5d1a94b commit 6f2370d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
Original file line number Diff line number Diff line change
@@ -1963,9 +1963,14 @@ parse_rx_slots(VCHIQ_STATE_T *state)
mutex_unlock(&service->bulk_mutex);
break;
}

BUG_ON(queue->process == queue->local_insert);
BUG_ON(queue->process != queue->remote_insert);
if (queue->process != queue->remote_insert) {
pr_err("%s: p %x != ri %x\n",
__func__,
queue->process,
queue->remote_insert);
mutex_unlock(&service->bulk_mutex);
goto bail_not_ready;
}

bulk = &queue->bulks[
BULK_INDEX(queue->remote_insert)];

0 comments on commit 6f2370d

Please sign in to comment.