[PATCH] media: sti: hva: Remove bogus mutex_unlock() in hva_hw_get_ip_version()
From: Xiangwu Lai
Date: Mon Nov 02 2026 - 20:35:11 EST
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@xxxxxxxxxxxxxxxxxxxx>
---
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;
}