All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: omap3isp: drop graph mutex on error path
@ 2021-04-13 10:37 Dan Carpenter
  2021-04-21 12:08 ` Sakari Ailus
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2021-04-13 10:37 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Sakari Ailus, linux-media, kernel-janitors

Drop the "&isp->media_dev.graph_mutex" if media_entity_enum_init() fails.

Fixes: ba689d933361 ("media: omap3isp: Acquire graph mutex for graph traversal")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/media/platform/omap3isp/isp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c
index 53025c8c7531..20f59c59ff8a 100644
--- a/drivers/media/platform/omap3isp/isp.c
+++ b/drivers/media/platform/omap3isp/isp.c
@@ -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)
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] media: omap3isp: drop graph mutex on error path
  2021-04-13 10:37 [PATCH] media: omap3isp: drop graph mutex on error path Dan Carpenter
@ 2021-04-21 12:08 ` Sakari Ailus
  0 siblings, 0 replies; 2+ messages in thread
From: Sakari Ailus @ 2021-04-21 12:08 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Laurent Pinchart, Mauro Carvalho Chehab, linux-media, kernel-janitors

Hi Dan,

On Tue, Apr 13, 2021 at 01:37:12PM +0300, Dan Carpenter wrote:
> Drop the "&isp->media_dev.graph_mutex" if media_entity_enum_init() fails.
> 
> Fixes: ba689d933361 ("media: omap3isp: Acquire graph mutex for graph traversal")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks for the fix.

I got another patch here earlier to fix the same bug so I've taken that
instead:

<URL:https://patchwork.linuxtv.org/project/linux-media/patch/20210407143733.1608806-1-weiyongjun1@huawei.com/>

-- 
Kind regards,

Sakari Ailus

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-21 12:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-13 10:37 [PATCH] media: omap3isp: drop graph mutex on error path Dan Carpenter
2021-04-21 12:08 ` Sakari Ailus

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.