On Tue Oct 14 12:46:43 2025 +0200, Marek Szyprowski wrote:
> v4l2_device_register_subdev_nodes() must called without taking
> media_dev->graph_mutex to avoid potential AB-BA deadlock on further
> subdevice driver initialization.
> 
> Fixes: fa91f1056f17 ("[media] exynos4-is: Add support for asynchronous 
> subdevices registration")
> Cc: [email protected]
> Signed-off-by: Marek Szyprowski <[email protected]>
> Acked-by: Sylwester Nawrocki <[email protected]>
> Signed-off-by: Hans Verkuil <[email protected]>

Patch committed.

Thanks,
Hans Verkuil

 drivers/media/platform/samsung/exynos4-is/media-dev.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

---

diff --git a/drivers/media/platform/samsung/exynos4-is/media-dev.c 
b/drivers/media/platform/samsung/exynos4-is/media-dev.c
index d6f7601de597..bc7087eb761a 100644
--- a/drivers/media/platform/samsung/exynos4-is/media-dev.c
+++ b/drivers/media/platform/samsung/exynos4-is/media-dev.c
@@ -1399,12 +1399,14 @@ static int subdev_notifier_complete(struct 
v4l2_async_notifier *notifier)
        mutex_lock(&fmd->media_dev.graph_mutex);
 
        ret = fimc_md_create_links(fmd);
-       if (ret < 0)
-               goto unlock;
+       if (ret < 0) {
+               mutex_unlock(&fmd->media_dev.graph_mutex);
+               return ret;
+       }
 
-       ret = v4l2_device_register_subdev_nodes(&fmd->v4l2_dev);
-unlock:
        mutex_unlock(&fmd->media_dev.graph_mutex);
+
+       ret = v4l2_device_register_subdev_nodes(&fmd->v4l2_dev);
        if (ret < 0)
                return ret;
 
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to