.. | .. |
---|
202 | 202 | unsigned code; |
---|
203 | 203 | enum rc_proto proto; |
---|
204 | 204 | |
---|
205 | | - az6007_read(d, AZ6007_READ_IR, 0, 0, st->data, 10); |
---|
| 205 | + if (az6007_read(d, AZ6007_READ_IR, 0, 0, st->data, 10) < 0) |
---|
| 206 | + return -EIO; |
---|
206 | 207 | |
---|
207 | 208 | if (st->data[1] == 0x44) |
---|
208 | 209 | return 0; |
---|
.. | .. |
---|
787 | 788 | if (az6007_xfer_debug) |
---|
788 | 789 | printk(KERN_DEBUG "az6007: I2C W addr=0x%x len=%d\n", |
---|
789 | 790 | addr, msgs[i].len); |
---|
| 791 | + if (msgs[i].len < 1) { |
---|
| 792 | + ret = -EIO; |
---|
| 793 | + goto err; |
---|
| 794 | + } |
---|
790 | 795 | req = AZ6007_I2C_WR; |
---|
791 | 796 | index = msgs[i].buf[0]; |
---|
792 | 797 | value = addr | (1 << 8); |
---|
.. | .. |
---|
801 | 806 | if (az6007_xfer_debug) |
---|
802 | 807 | printk(KERN_DEBUG "az6007: I2C R addr=0x%x len=%d\n", |
---|
803 | 808 | addr, msgs[i].len); |
---|
| 809 | + if (msgs[i].len < 1) { |
---|
| 810 | + ret = -EIO; |
---|
| 811 | + goto err; |
---|
| 812 | + } |
---|
804 | 813 | req = AZ6007_I2C_RD; |
---|
805 | 814 | index = msgs[i].buf[0]; |
---|
806 | 815 | value = addr; |
---|