linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] media: drxk: add a missed check of the return value of write16
@ 2018-12-25  8:03 Kangjie Lu
  2019-03-05 21:16 ` Sean Young
  0 siblings, 1 reply; 2+ messages in thread
From: Kangjie Lu @ 2018-12-25  8:03 UTC (permalink / raw)
  To: kjlu
  Cc: pakki001, Mauro Carvalho Chehab, Wolfram Sang, Peter Rosin,
	linux-media, linux-kernel

write16() could fail. The fix inserts a check for its return value
in case it fails.

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

diff --git a/drivers/media/dvb-frontends/drxk_hard.c b/drivers/media/dvb-frontends/drxk_hard.c
index 84ac3f73f8fe..b7579ffae690 100644
--- a/drivers/media/dvb-frontends/drxk_hard.c
+++ b/drivers/media/dvb-frontends/drxk_hard.c
@@ -6610,7 +6610,9 @@ static int drxk_get_stats(struct dvb_frontend *fe)
 	if (status < 0)
 		goto error;
 	pkt_error_count = reg16;
-	write16(state, SCU_RAM_FEC_ACCUM_PKT_FAILURES__A, 0);
+	status = write16(state, SCU_RAM_FEC_ACCUM_PKT_FAILURES__A, 0);
+	if (status < 0)
+		goto error;
 
 	post_bit_err_count *= post_bit_error_scale;
 
-- 
2.17.2 (Apple Git-113)


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

* Re: [PATCH] media: drxk: add a missed check of the return value of write16
  2018-12-25  8:03 [PATCH] media: drxk: add a missed check of the return value of write16 Kangjie Lu
@ 2019-03-05 21:16 ` Sean Young
  0 siblings, 0 replies; 2+ messages in thread
From: Sean Young @ 2019-03-05 21:16 UTC (permalink / raw)
  To: Kangjie Lu
  Cc: pakki001, Mauro Carvalho Chehab, Wolfram Sang, Peter Rosin,
	linux-media, linux-kernel

On Tue, Dec 25, 2018 at 02:03:07AM -0600, Kangjie Lu wrote:
> write16() could fail. The fix inserts a check for its return value
> in case it fails.
> 
> Signed-off-by: Kangjie Lu <kjlu@umn.edu>

Unless it is tested on the actual hardware we can't apply this. This could
introduce regressions.

Sean

> ---
>  drivers/media/dvb-frontends/drxk_hard.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/dvb-frontends/drxk_hard.c b/drivers/media/dvb-frontends/drxk_hard.c
> index 84ac3f73f8fe..b7579ffae690 100644
> --- a/drivers/media/dvb-frontends/drxk_hard.c
> +++ b/drivers/media/dvb-frontends/drxk_hard.c
> @@ -6610,7 +6610,9 @@ static int drxk_get_stats(struct dvb_frontend *fe)
>  	if (status < 0)
>  		goto error;
>  	pkt_error_count = reg16;
> -	write16(state, SCU_RAM_FEC_ACCUM_PKT_FAILURES__A, 0);
> +	status = write16(state, SCU_RAM_FEC_ACCUM_PKT_FAILURES__A, 0);
> +	if (status < 0)
> +		goto error;
>  
>  	post_bit_err_count *= post_bit_error_scale;
>  
> -- 
> 2.17.2 (Apple Git-113)

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

end of thread, other threads:[~2019-03-05 21:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-25  8:03 [PATCH] media: drxk: add a missed check of the return value of write16 Kangjie Lu
2019-03-05 21:16 ` Sean Young

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).