summaryrefslogtreecommitdiff
path: root/drivers/staging/vc04_services
diff options
context:
space:
mode:
authorStefan Wahren <stefan.wahren@i2se.com>2017-05-26 00:26:24 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-05-29 17:04:13 +0200
commit6f2370d260c4dc6eba1de2b4f55786f99abf937c (patch)
tree582be704810c6691d7e391b301a0b255a8a4eec9 /drivers/staging/vc04_services
parent5d1a94bb284c8d97b056e8025169609e78b7052f (diff)
staging: vchiq_core: Don't BUG if process is unexpected
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>
Diffstat (limited to 'drivers/staging/vc04_services')
-rw-r--r--drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
index 9cdc98570a22..b0119b80b776 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
@@ -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)];