LinuxTV Patchwork media: drxk: add a missed check of the return value of write16

login
register
mail settings
Submitter Kangjie Lu
Date Dec. 25, 2018, 8:03 a.m.
Message ID <20181225080308.68178-1-kjlu@umn.edu>
Download mbox | patch
Permalink /patch/53646/
State New
Headers show

Comments

Kangjie Lu - Dec. 25, 2018, 8:03 a.m.
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(-)

Patch

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;
 

Privacy Policy