Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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@weissschuh.net>
Reviewed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Link: https://lore.kernel.org/r/20250617-must_check-devm_mutex_init-v7-1-d9e449f4d224@weissschuh.net

authored by

Thomas Weißschuh and committed by
Boqun Feng
d24a54e0 7ff495e2

+3 -1
+3 -1
drivers/spi/spi-nxp-fspi.c
··· 1273 1273 if (ret) 1274 1274 return dev_err_probe(dev, ret, "Failed to request irq\n"); 1275 1275 1276 - devm_mutex_init(dev, &f->lock); 1276 + ret = devm_mutex_init(dev, &f->lock); 1277 + if (ret) 1278 + return dev_err_probe(dev, ret, "Failed to initialize lock\n"); 1277 1279 1278 1280 ctlr->bus_num = -1; 1279 1281 ctlr->num_chipselect = NXP_FSPI_MAX_CHIPSELECT;