From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-ID: <4AD32B3F.9060804@gmail.com> Date: Mon, 12 Oct 2009 15:12:31 +0200 From: Roel Kluin MIME-Version: 1.0 To: Jeremy Kerr , linuxppc-dev@ozlabs.org, cbe-oss-dev@ozlabs.org, Andrew Morton Subject: [PATCH] spufs: Fix test in spufs_switch_log_read() Content-Type: text/plain; charset=ISO-8859-1 List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , size_t len cannot be less than 0. Signed-off-by: Roel Kluin --- 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);