summaryrefslogtreecommitdiffstats
path: root/drivers/staging/media/platform/bcm2835/mmal-vchiq.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/media/platform/bcm2835/mmal-vchiq.c')
-rw-r--r--drivers/staging/media/platform/bcm2835/mmal-vchiq.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/staging/media/platform/bcm2835/mmal-vchiq.c b/drivers/staging/media/platform/bcm2835/mmal-vchiq.c
index f0639ee6c8b9..fdfb6a620a43 100644
--- a/drivers/staging/media/platform/bcm2835/mmal-vchiq.c
+++ b/drivers/staging/media/platform/bcm2835/mmal-vchiq.c
@@ -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;