diff mbox

spufs: Fix test in spufs_switch_log_read()

Message ID 4AD32B3F.9060804@gmail.com (mailing list archive)
State Changes Requested
Headers show

Commit Message

roel kluin Oct. 12, 2009, 1:12 p.m. UTC
size_t len cannot be less than 0.

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

Comments

Jeremy Kerr Oct. 13, 2009, 12:49 a.m. UTC | #1
Roel,

> Or can this test be removed?

I'd prefer just to remove the test.

Cheers,


Jeremy
Arnd Bergmann Oct. 13, 2009, 1:31 p.m. UTC | #2
On Tuesday 13 October 2009, Jeremy Kerr wrote:
> > Or can this test be removed?
> 
> I'd prefer just to remove the test.

Yes, sounds good.

	Arnd <><
diff mbox

Patch

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