public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Roel Kluin <roel.kluin@gmail•com>
To: Jeremy Kerr <jk@ozlabs•org>,
	linuxppc-dev@ozlabs•org, cbe-oss-dev@ozlabs•org,
	Andrew Morton <akpm@linux-foundation•org>
Subject: [PATCH] spufs: Fix test in spufs_switch_log_read()
Date: Mon, 12 Oct 2009 15:12:31 +0200	[thread overview]
Message-ID: <4AD32B3F.9060804@gmail.com> (raw)

size_t len cannot be less than 0.

Signed-off-by: Roel Kluin <roel.kluin@gmail•com>
---
Or can this test be removed?

diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c
index 884e8bc..d4f304f 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
@@ -2494,7 +2494,7 @@ static ssize_t spufs_switch_log_read(struct file *file, char __user *buf,
 	struct spu_context *ctx = SPUFS_I(inode)->i_ctx;
 	int error = 0, cnt = 0;
 
-	if (!buf || len < 0)
+	if (!buf || (ssize_t)len < 0)
 		return -EINVAL;
 
 	error = spu_acquire(ctx);

             reply	other threads:[~2009-10-12 13:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-12 13:12 Roel Kluin [this message]
2009-10-13  0:49 ` [Cbe-oss-dev] [PATCH] spufs: Fix test in spufs_switch_log_read() Jeremy Kerr
2009-10-13 13:31   ` Arnd Bergmann
2009-10-14 15:32     ` Roel Kluin
2009-11-24  0:24       ` Jeremy Kerr

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=4AD32B3F.9060804@gmail.com \
    --to=roel.kluin@gmail$(echo .)com \
    --cc=akpm@linux-foundation$(echo .)org \
    --cc=cbe-oss-dev@ozlabs$(echo .)org \
    --cc=jk@ozlabs$(echo .)org \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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