Thread (5 messages) 5 messages, 3 authors, 2009-11-24

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

From: Roel Kluin <hidden>
Date: 2009-10-14 15:32:28
Subsystem: cell broadband engine architecture, linux for powerpc (32-bit and 64-bit), spu file system, the rest · Maintainers: Madhavan Srinivasan, Michael Ellerman, Linus Torvalds

size_t len cannot be less than 0.

Signed-off-by: Roel Kluin <redacted>
---
quoted
quoted
Or can this test be removed?
I'd prefer just to remove the test.
Yes, sounds good.
If you meant only the left-hand part, here you go:
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c
index 884e8bc..64a4c2d 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)
 		return -EINVAL;
 
 	error = spu_acquire(ctx);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help