Skip to content

Commit 1ff203b

Browse files
can: tcan4x5x: tcan4x5x_can_probe(): add missing error checking for devm_regmap_init()
This patch adds the missing error checking when initializing the regmap interface fails. Fixes: 5443c22 ("can: tcan4x5x: Add tcan4x5x driver to the kernel") Cc: Dan Murphy <dmurphy@ti.com> Link: http://lore.kernel.org/r/20201019154233.1262589-7-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
1 parent 3fcce13 commit 1ff203b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/net/can/m_can/tcan4x5x.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,10 @@ static int tcan4x5x_can_probe(struct spi_device *spi)
487487

488488
priv->regmap = devm_regmap_init(&spi->dev, &tcan4x5x_bus,
489489
&spi->dev, &tcan4x5x_regmap);
490+
if (IS_ERR(priv->regmap)) {
491+
ret = PTR_ERR(priv->regmap);
492+
goto out_clk;
493+
}
490494

491495
ret = tcan4x5x_power_enable(priv->power, 1);
492496
if (ret)

0 commit comments

Comments
 (0)