summaryrefslogtreecommitdiff
path: root/drivers/media/spi
diff options
context:
space:
mode:
authorNeil Armstrong <narmstrong@baylibre.com>2018-11-08 15:44:48 +0300
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-12-03 21:26:48 +0300
commit458ffce1cb46e46e3cec48b625ed142250475708 (patch)
treeb1f5237f73c63d3b77528f0642b8abef7988a2b4 /drivers/media/spi
parentbac26a63f9bff338534610232c2827b877e0b312 (diff)
downloadlinux-458ffce1cb46e46e3cec48b625ed142250475708.tar.xz
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 <narmstrong@baylibre.com> Acked-by: Yasunari Takiguchi <Yasunari.Takiguchi@sony.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/spi')
-rw-r--r--drivers/media/spi/cxd2880-spi.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/media/spi/cxd2880-spi.c b/drivers/media/spi/cxd2880-spi.c
index 11ce5101e19f..c43730977f53 100644
--- a/drivers/media/spi/cxd2880-spi.c
+++ b/drivers/media/spi/cxd2880-spi.c
@@ -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;
}