spufs: Fix test in spufs_switch_log_read()
Subsystems (3)
PATCH 1/1 spufs: Fix test in spufs_switch_log_read()
size_t len cannot be less than 0.
Signed-off-by Roel Kluin <[email protected]>
---
Or can this test be removed?
arch/powerpc/platforms/cell/spufs/file.c +1 -1
@@ -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);
Roel,
Quoted 1 line
Or can this test be removed?
I'd prefer just to remove the test.
Cheers,
Jeremy
Quoted 3 lines · Jeremy Kerr
Quoted 1 line
Or can this test be removed?
I'd prefer just to remove the test.
Yes, sounds good.
Arnd <><
size_t len cannot be less than 0.
Signed-off-by Roel Kluin <[email protected]>
---
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
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:
arch/powerpc/platforms/cell/spufs/file.c +1 -1
@@ -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);
Jeremy Kerr
Acked-byRoel,
Quoted 3 lines
size_tlen cannot be less than 0.Signed-off-by Roel Kluin <[email protected]>
Acked-by Jeremy Kerr <[email protected]>
Thanks!
Jeremy