Skip to contentSkip to conversation

i2c: fix i2c-sh_mobile rx underrun

PATCH New Magnus Damm 1 participant 1 message Nov 13, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c: fix i2c-sh_mobile rx underrun

From: Magnus Damm <[email protected]>

Fix receive path underrun in i2c-sh_mobile driver.

---

Paul, can you include this with your other SuperH changes for 2.6.28?

 drivers/i2c/busses/i2c-sh_mobile.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/i2c/busses/i2c-sh_mobile.c +2 -1
@@ -318,7 +318,8 @@ static int sh_mobile_i2c_isr_rx(struct s
 		} 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++;