]> git.ipfire.org Git - people/arne_f/kernel.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Aug 2016 10:54:49 +0000 (12:54 +0200)
commit d4f56c7773483b8829e89cfc739b7a5a071f6da0 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/i2c/busses/i2c-qup.c

index 23eaabb19f961a9c80c82d759d653c5a109df01c..a5eb09c5539f5bbdc9aef9b0aaf21a2cfc5b06ae 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;