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

Submitted by roel kluin on Oct. 14, 2009, 3:32 p.m.

Details

Message ID 4AD5EF0C.9050603@gmail.com
State Accepted, archived
Commit 17e376756169af818c2e1c230502167cd1571a6c
Delegated to: Benjamin Herrenschmidt
Headers show

Commit Message

roel kluin Oct. 14, 2009, 3:32 p.m.
size_t len cannot be less than 0.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
>>> 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:

Comments

Jeremy Kerr Nov. 24, 2009, 12:24 a.m.
Roel,

> size_t len cannot be less than 0.
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>

Acked-by: Jeremy Kerr <jk@ozlabs.org>

Thanks!

Jeremy

Patch hide | download patch | download mbox

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