From: Stefan Wahren Date: Sat, 31 Mar 2018 20:09:37 +0000 (+0200) Subject: staging: vchiq_core: Fix missing semaphore release in error case X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=8113b89fc615cfb531df0334fb3a091cf6a45ce0;p=openwrt%2Fstaging%2Fblogic.git staging: vchiq_core: Fix missing semaphore release in error case The bail out branch in case of a invalid tx_pos missed a semaphore release. Dan Carpenter found this with a static checker. Fixes: d1eab9dec610 ("staging: vchiq_core: Bail out in case of invalid tx_pos") Reported-by: Dan Carpenter Signed-off-by: Stefan Wahren Signed-off-by: Greg Kroah-Hartman --- 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 5d28fff46557..80f6168f06f6 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c @@ -601,6 +601,7 @@ reserve_space(VCHIQ_STATE_T *state, size_t space, int is_blocking) } if (tx_pos == (state->slot_queue_available * VCHIQ_SLOT_SIZE)) { + up(&state->slot_available_event); pr_warn("%s: invalid tx_pos: %d\n", __func__, tx_pos); return NULL; }