On Tue Jun 30 21:40:28 2026 +0100, David Carlier wrote:
> In mali_c55_register_cap_dev(), a failure of media_entity_pads_init()
> destroys cap_dev->lock inline and then jumps to err_destroy_mutex, which
> destroys the same mutex a second time. Calling mutex_destroy() twice is
> harmless, so this is not a bugfix, but the inline call is redundant: the
> err_destroy_mutex label already covers this path, just like the switch
> default case immediately above.
> 
> Drop the inline mutex_destroy() and rely solely on the err_destroy_mutex
> label, so the mutex is destroyed exactly once on every error path.
> 
> Signed-off-by: David Carlier <[email protected]>
> Reviewed-by: Jacopo Mondi <[email protected]>
> Signed-off-by: Hans Verkuil <[email protected]>

Patch committed.

Thanks,
Hans Verkuil

 drivers/media/platform/arm/mali-c55/mali-c55-capture.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

---

diff --git a/drivers/media/platform/arm/mali-c55/mali-c55-capture.c 
b/drivers/media/platform/arm/mali-c55/mali-c55-capture.c
index 7aaa5c3f7354..ff01553026fb 100644
--- a/drivers/media/platform/arm/mali-c55/mali-c55-capture.c
+++ b/drivers/media/platform/arm/mali-c55/mali-c55-capture.c
@@ -857,10 +857,8 @@ static int mali_c55_register_cap_dev(struct mali_c55 
*mali_c55,
 
        cap_dev->pad.flags = MEDIA_PAD_FL_SINK;
        ret = media_entity_pads_init(&cap_dev->vdev.entity, 1, &cap_dev->pad);
-       if (ret) {
-               mutex_destroy(&cap_dev->lock);
+       if (ret)
                goto err_destroy_mutex;
-       }
 
        vb2q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
        vb2q->io_modes = VB2_MMAP | VB2_DMABUF;
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to