mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] media: sti: hva: Remove bogus mutex_unlock() in hva_hw_get_ip_version()
@ 2026-11-03  1:34 Xiangwu Lai
  2026-11-17  1:13 ` Xiangwu Lai
  0 siblings, 1 reply; 3+ messages in thread
From: Xiangwu Lai @ 2026-11-03  1:34 UTC (permalink / raw)
  To: Jean-Christophe Trotin, Mauro Carvalho Chehab
  Cc: linux-media, linux-kernel, Xiangwu Lai

When runtime resume fails, hva_hw_get_ip_version() calls
mutex_unlock() on hva->protect_mutex before returning.  The only
caller of this function is hva_hw_probe(), which does not hold
protect_mutex at that point, so the error path unlocks a mutex that
was never locked.

The line appears to be copied from the encode path in
hva_hw_execute_cmds(), which does run under protect_mutex.  Remove
it so that a failed runtime resume returns without corrupting the
mutex state.

Fixes: 57b2c0628b60 ("[media] st-hva: multi-format video encoder V4L2 driver")
Signed-off-by: Xiangwu Lai <laixiangwu@cmss.chinamobile.com>
---
 drivers/media/platform/st/sti/hva/hva-hw.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/platform/st/sti/hva/hva-hw.c b/drivers/media/platform/st/sti/hva/hva-hw.c
index fcb18fb52..bd33d8dab 100644
--- a/drivers/media/platform/st/sti/hva/hva-hw.c
+++ b/drivers/media/platform/st/sti/hva/hva-hw.c
@@ -271,7 +271,6 @@ static unsigned long int hva_hw_get_ip_version(struct hva_dev *hva)
 
 	if (pm_runtime_resume_and_get(dev) < 0) {
 		dev_err(dev, "%s     failed to get pm_runtime\n", HVA_PREFIX);
-		mutex_unlock(&hva->protect_mutex);
 		return -EFAULT;
 	}
 



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

end of thread, other threads:[~2026-11-26 22:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-03  1:34 [PATCH] media: sti: hva: Remove bogus mutex_unlock() in hva_hw_get_ip_version() Xiangwu Lai
2026-11-17  1:13 ` Xiangwu Lai
2026-11-26 22:11   ` Nicolas Dufresne

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®