From: Stephen Rothwell Date: Tue, 22 Jul 2025 10:27:54 +0000 (+0100) Subject: ASoC: SDCA: Check devm_mutex_init() return value X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5b838a24e9942d8b8da208f924701d0f989778cf;p=thirdparty%2Fkernel%2Flinux.git ASoC: SDCA: Check devm_mutex_init() return value 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 Signed-off-by: Charles Keepax Link: https://patch.msgid.link/20250722102754.2514351-1-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/sdca/sdca_interrupts.c b/sound/soc/sdca/sdca_interrupts.c index b76512732af87..d442ba2f56816 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);