aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorMagnus Damm <damm@igel.co.jp>2008-11-13 01:28:21 -0500
committerPaul Mundt <lethal@linux-sh.org>2008-11-13 01:37:07 -0500
commitbff4056c8b868a4311d5ebd6cbbf09a2c10f4551 (patch)
treea6ee2db33682deb761aae97a98a5983116151bc7 /drivers/i2c
parent185aed75570fb4f78ef283dfa26cd9da5fa06a91 (diff)
i2c: fix i2c-sh_mobile rx underrun
Fix receive path underrun in i2c-sh_mobile driver. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-sh_mobile.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c
index 640cbb237328..3384a717fec0 100644
--- a/drivers/i2c/busses/i2c-sh_mobile.c
+++ b/drivers/i2c/busses/i2c-sh_mobile.c
@@ -318,7 +318,8 @@ static int sh_mobile_i2c_isr_rx(struct sh_mobile_i2c_data *pd)
318 } else 318 } else
319 data = i2c_op(pd, OP_RX, 0); 319 data = i2c_op(pd, OP_RX, 0);
320 320
321 pd->msg->buf[real_pos] = data; 321 if (real_pos >= 0)
322 pd->msg->buf[real_pos] = data;
322 } while (0); 323 } while (0);
323 324
324 pd->pos++; 325 pd->pos++;