[PATCH 05/18] spi: core: don't ignore register_device failures
Marco Felsch
m.felsch at pengutronix.de
Mon Sep 28 11:50:28 EDT 2020
Add missing error handling for spi_new_device().
Signed-off-by: Marco Felsch <m.felsch at pengutronix.de>
---
drivers/spi/spi.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 0694f14c39..8421d9d7c1 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -103,7 +103,9 @@ struct spi_device *spi_new_device(struct spi_controller *ctrl,
goto fail;
}
- register_device(&proxy->dev);
+ status = register_device(&proxy->dev);
+ if (status)
+ goto fail;
return proxy;
fail:
--
2.20.1
More information about the barebox
mailing list