]> git.karo-electronics.de Git - linux-beck.git/commitdiff
i2c: qup: Fix wrong value of index variable
authorSricharan R <sricharan@codeaurora.org>
Fri, 10 Jun 2016 18:08:20 +0000 (23:38 +0530)
committerWolfram Sang <wsa@the-dreams.de>
Sat, 18 Jun 2016 16:33:13 +0000 (18:33 +0200)
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
drivers/i2c/busses/i2c-qup.c

index cc6439ab3f714145f4d86c49c3d3c79716a058b1..041050edd80991713d9bb5a776c9a1d402f23bf5 100644 (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;