Commit f4082c6f authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

staging: bcm2835/mmal-vchiq: unlock on error in buffer_from_host()

We should unlock before returning on this error path.

Fixes: 7b3ad5ab ("staging: Import the BCM2835 MMAL-based V4L2 camera driver.")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent dc7ffefd
......@@ -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;
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment