diff options
author | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-01-16 23:34:03 +0400 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-03-04 21:26:21 +0400 |
commit | b1d0a59649ea4a799502c858a4cb5d50c82d31f7 (patch) | |
tree | a54b8920511741c17335987432011f95b937d880 | |
parent | adc0e25893a40520f7bfca4e1ac910b5643ef0f2 (diff) | |
download | linux-b1d0a59649ea4a799502c858a4cb5d50c82d31f7.tar.xz |
[media] drx-j: Don't use buffer if an error occurs
drivers/media/dvb-frontends/drx39xyj/drxj.c: In function ‘drxj_dap_scu_atomic_read_reg16’:
drivers/media/dvb-frontends/drx39xyj/drxj.c:4170:9: warning: ‘*((void *)&buf+1)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
word = (u16) (buf[0] + (buf[1] << 8));
^
drivers/media/dvb-frontends/drx39xyj/drxj.c:4170:9: warning: ‘buf’ may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/media/dvb-frontends/drx39xyj/drxj.c: In function ‘drxj_dap_atomic_read_reg32.isra.59’:
drivers/media/dvb-frontends/drx39xyj/drxj.c:2186:7: warning: ‘*((void *)&buf+3)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
word = (u32) buf[3];
^
drivers/media/dvb-frontends/drx39xyj/drxj.c:2188:10: warning: ‘*((void *)&buf+2)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
word |= (u32) buf[2];
^
drivers/media/dvb-frontends/drx39xyj/drxj.c:2190:10: warning: ‘*((void *)&buf+1)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
word |= (u32) buf[1];
^
drivers/media/dvb-frontends/drx39xyj/drxj.c:2192:10: warning: ‘buf’ may be used uninitialized in this function [-Wmaybe-uninitialized]
word |= (u32) buf[0];
^
Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r-- | drivers/media/dvb-frontends/drx39xyj/drxj.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/media/dvb-frontends/drx39xyj/drxj.c b/drivers/media/dvb-frontends/drx39xyj/drxj.c index bb67edeb5121..d51cea9bc5eb 100644 --- a/drivers/media/dvb-frontends/drx39xyj/drxj.c +++ b/drivers/media/dvb-frontends/drx39xyj/drxj.c @@ -2183,6 +2183,9 @@ int drxj_dap_atomic_read_reg32(struct i2c_device_addr *dev_addr, rc = drxj_dap_atomic_read_write_block(dev_addr, addr, sizeof(*data), buf, true); + if (rc < 0) + return 0; + word = (u32) buf[3]; word <<= 8; word |= (u32) buf[2]; @@ -4166,6 +4169,8 @@ int drxj_dap_scu_atomic_read_reg16(struct i2c_device_addr *dev_addr, } rc = drxj_dap_scu_atomic_read_write_block(dev_addr, addr, 2, buf, true); + if (rc < 0) + return rc; word = (u16) (buf[0] + (buf[1] << 8)); |