i2c: qup: Fix wrong value of index variable

index gets incremented during check to determine if the
messages can be transferred with dma. But not reset after
that, resulting in wrong start value in subsequent loop,
causing failure. Fix it.

Signed-off-by: Sricharan R <sricharan@codeaurora.org>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: stable@kernel.org
This commit is contained in:
Sricharan R 2016-06-10 23:38:20 +05:30 committed by Wolfram Sang
parent 5edb56491d
commit d4f56c7773
1 changed files with 2 additions and 0 deletions

View File

@ -1268,6 +1268,8 @@ static int qup_i2c_xfer_v2(struct i2c_adapter *adap,
}
}
idx = 0;
do {
if (msgs[idx].len == 0) {
ret = -EINVAL;