]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
powerpc/spufs: Fix incorrect buffer offset in regs write
authorJeremy Kerr <jk@ozlabs.org>
Tue, 3 Mar 2009 19:39:32 +0000 (19:39 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 11 Mar 2009 06:11:32 +0000 (17:11 +1100)
We need to offset by *pos bytes, not *pos words.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/platforms/cell/spufs/file.c

index be0120d9b50a9c257ecd0839244e8367158dbb46..d6a519e6e1c1a0682efcb077e79178e0f1f425ce 100644 (file)
@@ -578,7 +578,7 @@ spufs_regs_write(struct file *file, const char __user *buffer,
        if (ret)
                return ret;
 
-       ret = copy_from_user(lscsa->gprs + *pos - size,
+       ret = copy_from_user((char *)lscsa->gprs + *pos - size,
                             buffer, size) ? -EFAULT : size;
 
        spu_release_saved(ctx);