linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] media: cxd2880-spi: fix probe when dvb_attach fails
@ 2018-11-08 12:44 Neil Armstrong
  2018-11-13  5:13 ` Yasunari.Takiguchi
  0 siblings, 1 reply; 2+ messages in thread
From: Neil Armstrong @ 2018-11-08 12:44 UTC (permalink / raw)
  To: Yasunari.Takiguchi; +Cc: Neil Armstrong, mchehab, linux-media, linux-kernel

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>
---
 drivers/media/spi/cxd2880-spi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/spi/cxd2880-spi.c b/drivers/media/spi/cxd2880-spi.c
index 11ce510..c437309 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;
 	}
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [PATCH] media: cxd2880-spi: fix probe when dvb_attach fails
  2018-11-08 12:44 [PATCH] media: cxd2880-spi: fix probe when dvb_attach fails Neil Armstrong
@ 2018-11-13  5:13 ` Yasunari.Takiguchi
  0 siblings, 0 replies; 2+ messages in thread
From: Yasunari.Takiguchi @ 2018-11-13  5:13 UTC (permalink / raw)
  To: narmstrong; +Cc: mchehab, linux-media, linux-kernel

Hi Neil,

Thanks for finding that.

Acked-by: Yasunari Takiguchi <Yasunari.Takiguchi@sony.com>


> -----Original Message-----
> From: Neil Armstrong [mailto:narmstrong@baylibre.com]
> Sent: Thursday, November 8, 2018 9:45 PM
> To: Takiguchi, Yasunari (SSS)
> Cc: Neil Armstrong; mchehab@kernel.org; linux-media@vger.kernel.org;
> linux-kernel@vger.kernel.org
> Subject: [PATCH] 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>
> ---
>  drivers/media/spi/cxd2880-spi.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/media/spi/cxd2880-spi.c
> b/drivers/media/spi/cxd2880-spi.c
> index 11ce510..c437309 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;
>  	}
> 
> --
> 2.7.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-13  5:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-08 12:44 [PATCH] media: cxd2880-spi: fix probe when dvb_attach fails Neil Armstrong
2018-11-13  5:13 ` Yasunari.Takiguchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).