From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: broonie@kernel.org
Cc: lgirdwood@gmail.com, yung-chuan.liao@linux.intel.com,
pierre-louis.bossart@linux.dev, peter.ujfalusi@linux.intel.com,
sfr@canb.auug.org.au, boqun.feng@gmail.com,
linux-next@vger.kernel.org, linux-sound@vger.kernel.org,
patches@opensource.cirrus.com
Subject: [PATCH] ASoC: SDCA: Check devm_mutex_init() return value
Date: Tue, 22 Jul 2025 11:27:54 +0100 [thread overview]
Message-ID: <20250722102754.2514351-1-ckeepax@opensource.cirrus.com> (raw)
From: Stephen Rothwell <sfr@canb.auug.org.au>
Fix interaction with commit daec29dcc873 ("locking/mutex: Mark
devm_mutex_init() as __must_check"), add return value check. There is no
need for additional complex error handling here, failure to init the
mutex means the code can't progress, so the failure just needs to be passed
up to the caller.
Fixes: b126394d9ec6 ("ASoC: SDCA: Generic interrupt support")
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
As Stephen's commit was fine I have just used that with some minor
tweaks to the commit message and removing the comment, I hope this is
ok.
Thanks,
Charles
sound/soc/sdca/sdca_interrupts.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sound/soc/sdca/sdca_interrupts.c b/sound/soc/sdca/sdca_interrupts.c
index b76512732af8..d442ba2f5681 100644
--- a/sound/soc/sdca/sdca_interrupts.c
+++ b/sound/soc/sdca/sdca_interrupts.c
@@ -419,7 +419,9 @@ struct sdca_interrupt_info *sdca_irq_allocate(struct device *dev,
info->irq_chip = sdca_irq_chip;
- devm_mutex_init(dev, &info->irq_lock);
+ ret = devm_mutex_init(dev, &info->irq_lock);
+ if (ret)
+ return ERR_PTR(ret);
ret = devm_regmap_add_irq_chip(dev, regmap, irq, IRQF_ONESHOT, 0,
&info->irq_chip, &info->irq_data);
--
2.39.5
next reply other threads:[~2025-07-22 10:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-22 10:27 Charles Keepax [this message]
2025-07-22 14:33 ` [PATCH] ASoC: SDCA: Check devm_mutex_init() return value Mark Brown
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=20250722102754.2514351-1-ckeepax@opensource.cirrus.com \
--to=ckeepax@opensource.cirrus.com \
--cc=boqun.feng@gmail.com \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-next@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
--cc=peter.ujfalusi@linux.intel.com \
--cc=pierre-louis.bossart@linux.dev \
--cc=sfr@canb.auug.org.au \
--cc=yung-chuan.liao@linux.intel.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