]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: omap3isp: Fix missing unlock in isp_subdev_notifier_complete()
authorWei Yongjun <weiyongjun1@huawei.com>
Wed, 7 Apr 2021 14:37:33 +0000 (16:37 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Sep 2021 08:00:42 +0000 (10:00 +0200)
[ Upstream commit 0368e7d2cd84a90d0518753fac33795e13df553f ]

Add the missing unlock before return from function
isp_subdev_notifier_complete() in the init error
handling case.

Fixes: ba689d933361 ("media: omap3isp: Acquire graph mutex for graph traversal")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/platform/omap3isp/isp.c

index 53025c8c753126203a7169236b28667c17145bcc..20f59c59ff8a25df8d78d61eb5c90318814c8b11 100644 (file)
@@ -2037,8 +2037,10 @@ static int isp_subdev_notifier_complete(struct v4l2_async_notifier *async)
        mutex_lock(&isp->media_dev.graph_mutex);
 
        ret = media_entity_enum_init(&isp->crashed, &isp->media_dev);
-       if (ret)
+       if (ret) {
+               mutex_unlock(&isp->media_dev.graph_mutex);
                return ret;
+       }
 
        list_for_each_entry(sd, &v4l2_dev->subdevs, list) {
                if (sd->notifier != &isp->notifier)