Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
[cascardo/linux.git] / drivers / gpu / drm / radeon / atombios_i2c.c
index deaf98c..0652ee0 100644 (file)
@@ -56,8 +56,10 @@ static int radeon_process_i2c_ch(struct radeon_i2c_chan *chan,
                        return -EINVAL;
                }
                args.ucRegIndex = buf[0];
-               if (num > 1)
-                       memcpy(&out, &buf[1], num - 1);
+               if (num > 1) {
+                       num--;
+                       memcpy(&out, &buf[1], num);
+               }
                args.lpI2CDataOut = cpu_to_le16(out);
        } else {
                if (num > ATOM_MAX_HW_I2C_READ) {