powerpc/spufs: Fix test in spufs_switch_log_read()

Previous thread: powerpc/kvm: Remove problematic BUILD_BUG_ON statement by Linux Kernel Mailing List on Saturday, December 12, 2009 - 4:59 pm. (1 message)

Next thread: powerpc/qe: Increase MAX_QE_RISC to 4 by Linux Kernel Mailing List on Saturday, December 12, 2009 - 4:59 pm. (1 message)
From: Linux Kernel Mailing List
Date: Saturday, December 12, 2009 - 4:59 pm

Gitweb:     http://git.kernel.org/linus/17e376756169af818c2e1c230502167cd1571a6c
Commit:     17e376756169af818c2e1c230502167cd1571a6c
Parent:     d67ebe72c9ce525019db9139153b55247d34b0a4
Author:     roel kluin <roel.kluin@gmail.com>
AuthorDate: Wed Oct 14 05:32:28 2009 +0000
Committer:  Benjamin Herrenschmidt <benh@kernel.crashing.org>
CommitDate: Tue Nov 24 14:31:25 2009 +1100

    powerpc/spufs: Fix test in spufs_switch_log_read()
    
    size_t len cannot be less than 0.
    
    Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
    Acked-by: Jeremy Kerr <jk@ozlabs.org>
    Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 arch/powerpc/platforms/cell/spufs/file.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

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

Previous thread: powerpc/kvm: Remove problematic BUILD_BUG_ON statement by Linux Kernel Mailing List on Saturday, December 12, 2009 - 4:59 pm. (1 message)

Next thread: powerpc/qe: Increase MAX_QE_RISC to 4 by Linux Kernel Mailing List on Saturday, December 12, 2009 - 4:59 pm. (1 message)