]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
media: s5p-mfc: Fix an error handling path s5p_mfc_open()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Tue, 19 Nov 2024 20:42:28 +0000 (21:42 +0100)
committerHans Verkuil <hverkuil@xs4all.nl>
Mon, 2 Dec 2024 13:05:26 +0000 (14:05 +0100)
A mfc_debug_enter() is not balanced by a corresponding mfc_debug_leave().
Add the missing call.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c

index 2fe3c9228ac54c1361a70c30cea6734394fee64b..5f80931f056dbf3f492a216aa09d4abea909a9d5 100644 (file)
@@ -774,8 +774,10 @@ static int s5p_mfc_open(struct file *file)
        int ret = 0;
 
        mfc_debug_enter();
-       if (mutex_lock_interruptible(&dev->mfc_mutex))
-               return -ERESTARTSYS;
+       if (mutex_lock_interruptible(&dev->mfc_mutex)) {
+               ret = -ERESTARTSYS;
+               goto err_enter;
+       }
        dev->num_inst++;        /* It is guarded by mfc_mutex in vfd */
        /* Allocate memory for context */
        ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
@@ -946,6 +948,7 @@ err_no_ctx:
 err_alloc:
        dev->num_inst--;
        mutex_unlock(&dev->mfc_mutex);
+err_enter:
        mfc_debug_leave();
        return ret;
 }