[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <175294681741.1420.3193151064662689491.tip-bot2@tip-bot2>
Date: Sat, 19 Jul 2025 17:40:17 -0000
From: tip-bot2 for Thomas Weißschuh <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: linux@...ssschuh.net, Mark Brown <broonie@...nel.org>,
Boqun Feng <boqun.feng@...il.com>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: [tip: locking/core] spi: spi-nxp-fspi: Check return value of
devm_mutex_init()
The following commit has been merged into the locking/core branch of tip:
Commit-ID: d24a54e032021cf381af3c3cf119cc5cf6b3c1be
Gitweb: https://git.kernel.org/tip/d24a54e032021cf381af3c3cf119cc5cf6b3c1be
Author: Thomas Weißschuh <linux@...ssschuh.net>
AuthorDate: Tue, 17 Jun 2025 19:08:12 +02:00
Committer: Boqun Feng <boqun.feng@...il.com>
CommitterDate: Fri, 11 Jul 2025 15:02:07 -07:00
spi: spi-nxp-fspi: Check return value of devm_mutex_init()
devm_mutex_init() can fail. With CONFIG_DEBUG_MUTEXES=y the mutex will
be marked as unusable and trigger errors on usage.
Add the missed check.
Fixes: 48900813abd2 ("spi: spi-nxp-fspi: remove the goto in probe")
Signed-off-by: Thomas Weißschuh <linux@...ssschuh.net>
Reviewed-by: Mark Brown <broonie@...nel.org>
Signed-off-by: Boqun Feng <boqun.feng@...il.com>
Link: https://lore.kernel.org/r/20250617-must_check-devm_mutex_init-v7-1-d9e449f4d224@weissschuh.net
---
drivers/spi/spi-nxp-fspi.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/spi/spi-nxp-fspi.c b/drivers/spi/spi-nxp-fspi.c
index e63c77e..f3d5765 100644
--- a/drivers/spi/spi-nxp-fspi.c
+++ b/drivers/spi/spi-nxp-fspi.c
@@ -1273,7 +1273,9 @@ static int nxp_fspi_probe(struct platform_device *pdev)
if (ret)
return dev_err_probe(dev, ret, "Failed to request irq\n");
- devm_mutex_init(dev, &f->lock);
+ ret = devm_mutex_init(dev, &f->lock);
+ if (ret)
+ return dev_err_probe(dev, ret, "Failed to initialize lock\n");
ctlr->bus_num = -1;
ctlr->num_chipselect = NXP_FSPI_MAX_CHIPSELECT;
Powered by blists - more mailing lists