[Cbe-oss-dev] [PATCH] spufs: Fix test in spufs_switch_log_read()

Roel Kluin roel.kluin at gmail.com
Tue Oct 13 00:12:31 EST 2009


size_t len cannot be less than 0.

Signed-off-by: Roel Kluin <roel.kluin at 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);


More information about the cbe-oss-dev mailing list