]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/i2c/busses/i2c-sh_mobile.c
i2c: fix i2c-sh_mobile rx underrun
[linux-2.6-omap-h63xx.git] / drivers / i2c / busses / i2c-sh_mobile.c
index 640cbb237328196b1b3b22a91fea4b9ee42bf3b1..3384a717fec0d1d864eff63d8d0c798d7edd47cc 100644 (file)
@@ -318,7 +318,8 @@ static int sh_mobile_i2c_isr_rx(struct sh_mobile_i2c_data *pd)
                } else
                        data = i2c_op(pd, OP_RX, 0);
 
-               pd->msg->buf[real_pos] = data;
+               if (real_pos >= 0)
+                       pd->msg->buf[real_pos] = data;
        } while (0);
 
        pd->pos++;