mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Lee Jones <lee@kernel.org>
Cc: Aaro Koskinen <aaro.koskinen@iki.fi>,
	Andreas Kemnade <andreas@kemnade.info>,
	Kevin Hilman <khilman@baylibre.com>,
	Roger Quadros <rogerq@kernel.org>,
	Tony Lindgren <tony@atomide.com>, Mark Brown <broonie@kernel.org>,
	mfd@lists.linux.dev, linux-omap@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Bart Van Assche <bvanassche@acm.org>
Subject: [PATCH] mfd: twl4030-irq: Fix a lock leak in twl4030_sih_bus_sync_unlock()
Date: Mon, 26 Oct 2026 12:55:46 -0700	[thread overview]
Message-ID: <8aec913c6a80c26c4cf5a1ce590f8439c997dafc.1793044546.git.bvanassche@acm.org> (raw)

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);
 }
 

             reply	other threads:[~2026-10-26 19:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-26 19:55 Bart Van Assche [this message]
2026-11-04 11:22 ` (subset) " Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8aec913c6a80c26c4cf5a1ce590f8439c997dafc.1793044546.git.bvanassche@acm.org \
    --to=bvanassche@acm.org \
    --cc=aaro.koskinen@iki.fi \
    --cc=andreas@kemnade.info \
    --cc=broonie@kernel.org \
    --cc=khilman@baylibre.com \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=mfd@lists.linux.dev \
    --cc=rogerq@kernel.org \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®