Patchwork powerpc/spufs: negative size in spufs_{regs/fpcr}_write

login
register
mail settings
Submitter roel kluin
Date March 3, 2009, 6:42 p.m.
Message ID <49AD7A06.2090401@gmail.com>
Download mbox | patch
Permalink /patch/24005/
State Superseded
Headers show

Comments

roel kluin - March 3, 2009, 6:42 p.m.
When stored in size_t size, the test 'size <= 0' does no longer work.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---

Patch

diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c
index 0da7f2b..05dba47 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
@@ -569,7 +569,7 @@  spufs_regs_write(struct file *file, const char __user *buffer,
 	int ret;
 
 	size = min_t(ssize_t, sizeof lscsa->gprs - *pos, size);
-	if (size <= 0)
+	if ((ssize_t)size <= 0)
 		return -EFBIG;
 	*pos += size;
 
@@ -624,7 +624,7 @@  spufs_fpcr_write(struct file *file, const char __user * buffer,
 	int ret;
 
 	size = min_t(ssize_t, sizeof(lscsa->fpcr) - *pos, size);
-	if (size <= 0)
+	if ((ssize_t)size <= 0)
 		return -EFBIG;
 
 	ret = spu_acquire_saved(ctx);