Skip to contentSkip to conversation

ASoC: SDCA: Check devm_mutex_init() return value

PATCH In review Charles Keepax 2 participants 2 messages Jul 22, 2025

Subsystems (4)
lore
Share & tools
lore

Charles Keepax

author maintainer
#0 lore raw

PATCH 1/1 ASoC: SDCA: Check devm_mutex_init() return value

From: Stephen Rothwell <[email protected]>

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")

---

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(-)
sound/soc/sdca/sdca_interrupts.c +3 -1
index b76512732af8..d442ba2f5681 100644
@@ -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);
Signature · 1 line
2.39.5
maintainer
#1 lore raw
Quoted 8 lines · Charles Keepax

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.

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: SDCA: Check devm_mutex_init() return value

      commit: 5b838a24e9942d8b8da208f924701d0f989778cf

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark