diff options
author | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-11-01 17:06:00 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-12-11 13:04:53 -0500 |
commit | 452c6446948e32018014ddadf93c525bf1f907ac (patch) | |
tree | c3485e4f935dda24cafc9a2583c5772d71aeff74 /drivers/media/dvb-frontends/drx39xyj/drxj.c | |
parent | 00b4bac78f6f607c5882bfdc03008b7acf802349 (diff) |
media: drxj: better handle errors
as reported by smatch:
drivers/media/dvb-frontends/drx39xyj/drxj.c:2157 drxj_dap_atomic_read_write_block() error: uninitialized symbol 'word'.
The driver doesn't check if a read error occurred. Add such
check.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/dvb-frontends/drx39xyj/drxj.c')
-rw-r--r-- | drivers/media/dvb-frontends/drx39xyj/drxj.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/media/dvb-frontends/drx39xyj/drxj.c b/drivers/media/dvb-frontends/drx39xyj/drxj.c index 8cbd8cc21059..77d3a44177ba 100644 --- a/drivers/media/dvb-frontends/drx39xyj/drxj.c +++ b/drivers/media/dvb-frontends/drx39xyj/drxj.c @@ -2151,9 +2151,13 @@ int drxj_dap_atomic_read_write_block(struct i2c_device_addr *dev_addr, if (read_flag) { /* read data from buffer */ for (i = 0; i < (datasize / 2); i++) { - drxj_dap_read_reg16(dev_addr, - (DRXJ_HI_ATOMIC_BUF_START + i), - &word, 0); + rc = drxj_dap_read_reg16(dev_addr, + (DRXJ_HI_ATOMIC_BUF_START + i), + &word, 0); + if (rc) { + pr_err("error %d\n", rc); + goto rw_error; + } data[2 * i] = (u8) (word & 0xFF); data[(2 * i) + 1] = (u8) (word >> 8); } |