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: bd24fcddf6 ("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>
This commit is contained in:
Neil Armstrong 2018-11-08 07:44:48 -05:00 committed by Mauro Carvalho Chehab
parent bac26a63f9
commit 458ffce1cb
1 changed files with 1 additions and 0 deletions

View File

@ -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;
}