mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Richard Fitzgerald <rf@opensource.cirrus.com>
To: vkoul@kernel.org
Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
	patches@opensource.cirrus.com
Subject: [PATCH] soundwire: irq: Invalidate slave->irq before disposing the mapping
Date: Mon, 31 Aug 2026 12:57:24 +0100	[thread overview]
Message-ID: <20260831115724.135619-1-rf@opensource.cirrus.com> (raw)

In sdw_irq_dispose_mapping() invalidate the value in slave->irq before
calling irq_dispose_mapping().

This fixes the potential problem with the original code that slave->irq
was left with the value of the disposed mapping, so it looked like it
was still a valid IRQ.

Fixes: a5fef9baa87f ("soundwire: bus: Move irq mapping cleanup into devres")
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
---
 drivers/soundwire/irq.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/soundwire/irq.c b/drivers/soundwire/irq.c
index f18be37efef8e..f0de5a5e5eb43 100644
--- a/drivers/soundwire/irq.c
+++ b/drivers/soundwire/irq.c
@@ -49,8 +49,12 @@ void sdw_irq_delete(struct sdw_bus *bus)
 static void sdw_irq_dispose_mapping(void *data)
 {
 	struct sdw_slave *slave = data;
+	int irq = slave->irq;
 
-	irq_dispose_mapping(slave->irq);
+	slave->irq = 0;
+
+	if (irq)
+		irq_dispose_mapping(irq);
 }
 
 void sdw_irq_create_mapping(struct sdw_slave *slave)
-- 
2.47.3


             reply	other threads:[~2026-08-31 11:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 11:57 Richard Fitzgerald [this message]
2026-08-31 13:07 ` Richard Fitzgerald

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=20260831115724.135619-1-rf@opensource.cirrus.com \
    --to=rf@opensource.cirrus.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=vkoul@kernel.org \
    /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®