Skip to content

Commit

Permalink
staging: bcm2835/mmal-vchiq: unlock on error in buffer_from_host()
Browse files Browse the repository at this point in the history
We should unlock before returning on this error path.

Fixes: 7b3ad5a ("staging: Import the BCM2835 MMAL-based V4L2 camera driver.")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed Feb 26, 2017
1 parent dc7ffef commit f4082c6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/staging/media/platform/bcm2835/mmal-vchiq.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,10 @@ buffer_from_host(struct vchiq_mmal_instance *instance,

/* get context */
msg_context = get_msg_context(instance);
if (msg_context == NULL)
return -ENOMEM;
if (!msg_context) {
ret = -ENOMEM;
goto unlock;
}

/* store bulk message context for when data arrives */
msg_context->u.bulk.instance = instance;
Expand Down Expand Up @@ -454,6 +456,7 @@ buffer_from_host(struct vchiq_mmal_instance *instance,

vchi_service_release(instance->handle);

unlock:
mutex_unlock(&instance->bulk_mutex);

return ret;
Expand Down

0 comments on commit f4082c6

Please sign in to comment.