All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] spufs: Fix test in spufs_switch_log_read()
@ 2009-10-12 13:12 Roel Kluin
  2009-10-13  0:49 ` [Cbe-oss-dev] " Jeremy Kerr
  0 siblings, 1 reply; 5+ messages in thread
From: Roel Kluin @ 2009-10-12 13:12 UTC (permalink / raw)
  To: Jeremy Kerr, linuxppc-dev, cbe-oss-dev, Andrew Morton

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);

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-11-24  0:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-12 13:12 [PATCH] spufs: Fix test in spufs_switch_log_read() Roel Kluin
2009-10-13  0:49 ` [Cbe-oss-dev] " Jeremy Kerr
2009-10-13 13:31   ` Arnd Bergmann
2009-10-14 15:32     ` Roel Kluin
2009-11-24  0:24       ` Jeremy Kerr

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.