public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@ozlabs.org, cbe-oss-dev@ozlabs.org,
	linux-kernel@vger.kernel.org,
	Arnd Bergmann <arnd.bergmann@de.ibm.com>
Subject: [PATCH 2/3] spufs: fix another off-by-one bug in mbox_read
Date: Tue, 24 Oct 2006 18:01:42 +0200	[thread overview]
Message-ID: <20061024160406.923275000@arndb.de> (raw)
In-Reply-To: 20061024160140.452484000@arndb.de

[-- Attachment #1: spufs-mbox-fix-fix.diff --]
[-- Type: text/plain, Size: 664 bytes --]

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

Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>

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)

--


  reply	other threads:[~2006-10-24 16:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-24 16:01 [PATCH 0/3] cell fixes 2.6.19 Arnd Bergmann
2006-10-24 16:01 ` Arnd Bergmann [this message]
2006-10-24 18:42   ` [PATCH 2/3] spufs: fix another off-by-one bug in mbox_read Pekka Enberg
2006-10-24 19:07     ` Arnd Bergmann
2006-10-24 19:53       ` Will Schmidt
2006-10-24 19:58         ` Arnd Bergmann
2006-10-24 16:01 ` [PATCH 3/3] cell: update defconfig Arnd Bergmann
2006-10-24 16:27 ` [PATCH 1/3] spufs: fix signal2 file to report signal2 Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061024160406.923275000@arndb.de \
    --to=arnd@arndb.de \
    --cc=arnd.bergmann@de.ibm.com \
    --cc=cbe-oss-dev@ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox