All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: mt312: fix a missing check of mt312 reset
@ 2018-12-21  7:07 Kangjie Lu
  2018-12-24 11:23 ` Matthias Schwarzott
  0 siblings, 1 reply; 2+ messages in thread
From: Kangjie Lu @ 2018-12-21  7:07 UTC (permalink / raw)
  To: kjlu
  Cc: pakki001, Mauro Carvalho Chehab, Hans Verkuil, linux-media, linux-kernel

mt312_reset() may fail. Although it is called in the end of
mt312_set_frontend(), we better check its status and return its error
code upstream instead of 0.

Signed-off-by: Kangjie Lu <kjlu@umn.edu>
---
 drivers/media/dvb-frontends/mt312.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/media/dvb-frontends/mt312.c b/drivers/media/dvb-frontends/mt312.c
index 03e74a729168..bfbb879469f2 100644
--- a/drivers/media/dvb-frontends/mt312.c
+++ b/drivers/media/dvb-frontends/mt312.c
@@ -645,7 +645,9 @@ static int mt312_set_frontend(struct dvb_frontend *fe)
 	if (ret < 0)
 		return ret;
 
-	mt312_reset(state, 0);
+	ret = mt312_reset(state, 0);
+	if (ret < 0)
+		return ret;
 
 	return 0;
 }
-- 
2.17.2 (Apple Git-113)


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

* Re: [PATCH] media: mt312: fix a missing check of mt312 reset
  2018-12-21  7:07 [PATCH] media: mt312: fix a missing check of mt312 reset Kangjie Lu
@ 2018-12-24 11:23 ` Matthias Schwarzott
  0 siblings, 0 replies; 2+ messages in thread
From: Matthias Schwarzott @ 2018-12-24 11:23 UTC (permalink / raw)
  To: Kangjie Lu
  Cc: pakki001, Mauro Carvalho Chehab, Hans Verkuil, linux-media, linux-kernel

Am 21.12.18 um 08:07 schrieb Kangjie Lu:
> mt312_reset() may fail. Although it is called in the end of
> mt312_set_frontend(), we better check its status and return its error
> code upstream instead of 0.
> 
> Signed-off-by: Kangjie Lu <kjlu@umn.edu>

Thanks for submitting this patch. It looks correct.

Reviewed-by: Matthias Schwarzott <zzam@gentoo.org>

> ---
>  drivers/media/dvb-frontends/mt312.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/dvb-frontends/mt312.c b/drivers/media/dvb-frontends/mt312.c
> index 03e74a729168..bfbb879469f2 100644
> --- a/drivers/media/dvb-frontends/mt312.c
> +++ b/drivers/media/dvb-frontends/mt312.c
> @@ -645,7 +645,9 @@ static int mt312_set_frontend(struct dvb_frontend *fe)
>  	if (ret < 0)
>  		return ret;
>  
> -	mt312_reset(state, 0);
> +	ret = mt312_reset(state, 0);
> +	if (ret < 0)
> +		return ret;
>  
>  	return 0;
>  }
> 


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

end of thread, other threads:[~2018-12-24 11:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-21  7:07 [PATCH] media: mt312: fix a missing check of mt312 reset Kangjie Lu
2018-12-24 11:23 ` Matthias Schwarzott

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.