media: cxd2880-spi: fix probe when dvb_attach fails
Subsystems (2)
PATCH 1/1 media: cxd2880-spi: fix probe when dvb_attach fails
When dvb_attach fails, probe returns 0, and remove crashes afterwards. This patch sets the return value to -ENODEV when attach fails.
Fixes bd24fcddf6b8 ("media: cxd2880-spi: Add support for CXD2880 SPI interface")
Signed-off-by Neil Armstrong <[email protected]>
--- drivers/media/spi/cxd2880-spi.c | 1 + 1 file changed, 1 insertion(+)
drivers/media/spi/cxd2880-spi.c +1 -0
@@ -536,6 +536,7 @@ cxd2880_spi_probe(struct spi_device *spi)if (!dvb_attach (cxd2880_attach, &dvb_spi->dvb_fe, &config)) {pr_err ("cxd2880_attach failed\n" ); + ret = -ENODEV ; goto fail_attach; }
Signature · 1 line
2.7.4
Hi Neil,
Thanks for finding that.
Quoted 33 lines
-----Original Message-----
From: Neil Armstrong [mailto:[email protected]]
Sent: Thursday, November 8, 2018 9:45 PM
To: Takiguchi, Yasunari (SSS)
Cc: Neil Armstrong; [email protected]; [email protected]; [email protected]
Subject: [PATCH] media: cxd2880-spi: fix probe whendvb_attachfailsWhen
dvb_attachfails, probe returns 0, and remove crashes afterwards. This patch sets the return value to-ENODEVwhen attach fails.Fixes bd24fcddf6b8 ("media: cxd2880-spi: Add support for CXD2880 SPIinterface")
Signed-off-by Neil Armstrong <[email protected]>--- drivers/media/spi/cxd2880-spi.c | 1 + 1 file changed, 1 insertion(+)drivers/media/spi/cxd2880-spi.c +1
-1@@ -536,6 +536,7 @@ cxd2880_spi_probe(struct spi_device *spi)if (!dvb_attach (cxd2880_attach, &dvb_spi->dvb_fe, &config)) {pr_err ("cxd2880_attach failed\n" ); + ret = -ENODEV ; goto fail_attach; } --2.7.4