* [PATCH] spufs: Fix test in spufs_switch_log_read()
@ 2009-10-12 13:12 Roel Kluin
2009-10-13 0:49 ` [Cbe-oss-dev] " Jeremy Kerr
0 siblings, 1 reply; 5+ messages in thread
From: Roel Kluin @ 2009-10-12 13:12 UTC (permalink / raw)
To: Jeremy Kerr, linuxppc-dev, cbe-oss-dev, Andrew Morton
size_t len cannot be less than 0.
Signed-off-by: Roel Kluin <roel.kluin@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);
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Cbe-oss-dev] [PATCH] spufs: Fix test in spufs_switch_log_read()
2009-10-12 13:12 [PATCH] spufs: Fix test in spufs_switch_log_read() Roel Kluin
@ 2009-10-13 0:49 ` Jeremy Kerr
2009-10-13 13:31 ` Arnd Bergmann
0 siblings, 1 reply; 5+ messages in thread
From: Jeremy Kerr @ 2009-10-13 0:49 UTC (permalink / raw)
To: cbe-oss-dev; +Cc: linuxppc-dev, Andrew Morton, Roel Kluin, cbe-oss-dev
Roel,
> Or can this test be removed?
I'd prefer just to remove the test.
Cheers,
Jeremy
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Cbe-oss-dev] [PATCH] spufs: Fix test in spufs_switch_log_read()
2009-10-13 0:49 ` [Cbe-oss-dev] " Jeremy Kerr
@ 2009-10-13 13:31 ` Arnd Bergmann
2009-10-14 15:32 ` Roel Kluin
0 siblings, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2009-10-13 13:31 UTC (permalink / raw)
To: linuxppc-dev
Cc: cbe-oss-dev, Roel Kluin, linuxppc-dev, Jeremy Kerr,
Andrew Morton, cbe-oss-dev
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 <><
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Cbe-oss-dev] [PATCH] spufs: Fix test in spufs_switch_log_read()
2009-10-13 13:31 ` Arnd Bergmann
@ 2009-10-14 15:32 ` Roel Kluin
2009-11-24 0:24 ` Jeremy Kerr
0 siblings, 1 reply; 5+ messages in thread
From: Roel Kluin @ 2009-10-14 15:32 UTC (permalink / raw)
To: Arnd Bergmann
Cc: cbe-oss-dev, linuxppc-dev, Jeremy Kerr, Andrew Morton,
linuxppc-dev, cbe-oss-dev
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:
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);
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Cbe-oss-dev] [PATCH] spufs: Fix test in spufs_switch_log_read()
2009-10-14 15:32 ` Roel Kluin
@ 2009-11-24 0:24 ` Jeremy Kerr
0 siblings, 0 replies; 5+ messages in thread
From: Jeremy Kerr @ 2009-11-24 0:24 UTC (permalink / raw)
To: Roel Kluin; +Cc: cbe-oss-dev, Andrew Morton, Arnd Bergmann, linuxppc-dev
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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-11-24 0:24 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-12 13:12 [PATCH] spufs: Fix test in spufs_switch_log_read() Roel Kluin
2009-10-13 0:49 ` [Cbe-oss-dev] " Jeremy Kerr
2009-10-13 13:31 ` Arnd Bergmann
2009-10-14 15:32 ` Roel Kluin
2009-11-24 0:24 ` Jeremy Kerr
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.