Thread (8 messages) 8 messages, 3 authors, 2006-10-24

Lifecycle

  1. Posted Arnd Bergmann <arnd@arndb.de>

[PATCH 2/3] spufs: fix another off-by-one bug in mbox_read

From: Arnd Bergmann <arnd@arndb.de>
Date: 2006-10-24 16:28:11
Also in: lkml

Next try, the previous one did not do what I expected.

Signed-off-by: Arnd Bergmann <redacted>

Index: linux-2.6/arch/powerpc/platforms/cell/spufs/file.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/cell/spufs/file.c
+++ linux-2.6/arch/powerpc/platforms/cell/spufs/file.c
@@ -385,7 +385,7 @@ static ssize_t spufs_mbox_read(struct fi
 	udata = (void __user *)buf;
 
 	spu_acquire(ctx);
-	for (count = 0; count <= len; count += 4, udata++) {
+	for (count = 0; (count + 4) <= len; count += 4, udata++) {
 		int ret;
 		ret = ctx->ops->mbox_read(ctx, &mbox_data);
 		if (ret == 0)

--
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help