Skip to content

Commit d24a54e

Browse files
t-8chfbq
authored andcommitted
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: 4890081 ("spi: spi-nxp-fspi: remove the goto in probe") Signed-off-by: Thomas Weißschuh <[email protected]> Reviewed-by: Mark Brown <[email protected]> Signed-off-by: Boqun Feng <[email protected]> Link: https://lore.kernel.org/r/20250617-must_check-devm_mutex_init-v7-1-d9e449f4d224@weissschuh.net
1 parent 7ff495e commit d24a54e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/spi/spi-nxp-fspi.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1273,7 +1273,9 @@ static int nxp_fspi_probe(struct platform_device *pdev)
12731273
if (ret)
12741274
return dev_err_probe(dev, ret, "Failed to request irq\n");
12751275

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

12781280
ctlr->bus_num = -1;
12791281
ctlr->num_chipselect = NXP_FSPI_MAX_CHIPSELECT;

0 commit comments

Comments
 (0)