From: roel kluin Date: Wed, 14 Oct 2009 05:32:28 +0000 (+0000) Subject: powerpc/spufs: Fix test in spufs_switch_log_read() X-Git-Tag: v2.6.33-rc1~293^2~55 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=17e376756169af818c2e1c230502167cd1571a6c;p=~shefty%2Frdma-dev.git powerpc/spufs: Fix test in spufs_switch_log_read() size_t len cannot be less than 0. Signed-off-by: Roel Kluin Acked-by: Jeremy Kerr Signed-off-by: Benjamin Herrenschmidt --- diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c index 884e8bcec49..64a4c2d85f7 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);