mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mfd: twl4030-irq: Fix a lock leak in twl4030_sih_bus_sync_unlock()
@ 2026-10-26 19:55 Bart Van Assche
  2026-11-04 11:22 ` (subset) " Lee Jones
  0 siblings, 1 reply; 2+ messages in thread
From: Bart Van Assche @ 2026-10-26 19:55 UTC (permalink / raw)
  To: Lee Jones
  Cc: Aaro Koskinen, Andreas Kemnade, Kevin Hilman, Roger Quadros,
	Tony Lindgren, Mark Brown, mfd, linux-omap, linux-kernel,
	Bart Van Assche

If reading the EDR registers fails, twl4030_sih_bus_sync_unlock()
returns without unlocking agent->irq_lock. Fix this by jumping to a new
label in front of the mutex_unlock() call. This bug has been detected by
the Clang thread-safety analyzer.

Fixes: 2f2a7d5ef764 ("mfd: Drop twl4030-irq's edge_work")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/mfd/twl4030-irq.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mfd/twl4030-irq.c b/drivers/mfd/twl4030-irq.c
index 06809f68b007..9ca000c5c779 100644
--- a/drivers/mfd/twl4030-irq.c
+++ b/drivers/mfd/twl4030-irq.c
@@ -513,7 +513,7 @@ static void twl4030_sih_bus_sync_unlock(struct irq_data *data)
 		if (status) {
 			pr_err("twl4030: %s, %s --> %d\n", __func__,
 					"read", status);
-			return;
+			goto unlock;
 		}
 
 		/* Modify only the bits we know must change */
@@ -542,6 +542,7 @@ static void twl4030_sih_bus_sync_unlock(struct irq_data *data)
 					"write", status);
 	}
 
+unlock:
 	mutex_unlock(&agent->irq_lock);
 }
 

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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-26 19:55 [PATCH] mfd: twl4030-irq: Fix a lock leak in twl4030_sih_bus_sync_unlock() Bart Van Assche
2026-11-04 11:22 ` (subset) " Lee Jones

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®