From patchwork Tue Mar 3 18:42:14 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: roel kluin X-Patchwork-Id: 24007 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 77DD1DE001 for ; Wed, 4 Mar 2009 08:48:36 +1100 (EST) X-Original-To: cbe-oss-dev@ozlabs.org Delivered-To: cbe-oss-dev@ozlabs.org Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.190]) by ozlabs.org (Postfix) with ESMTP id 8DFAFDDFC2; Wed, 4 Mar 2009 05:42:15 +1100 (EST) Received: by nf-out-0910.google.com with SMTP id k4so868432nfd.9 for ; Tue, 03 Mar 2009 10:42:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:content-type :content-transfer-encoding; bh=oRdR9hNv3K+wNRN8aaYCzjjYe0iSy33om0jvSt2rAKk=; b=JF9W6PEC9U40itQa1GSwK87qI01MYUG1GLowgqhfpOsAenltOuKTFSaXKgHmR8yVwT D6uUvmJ39tygoPaZNITIpDXsBKSHxpNnN0qXa9ws/jciu+AjvZJBkiEkkx3/vb9np3AN RAXEBJ0WU+rz5mxpmPiSv3Aswjhdx5FVVJ4CQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; b=sEJnDSKGq6TTx73kjrtKeNGj92E5aSz0HuPyV/lGOY9P39n9TYldKg/rJODDnXblYr rbZQEvVLvjDcs2jDUmA5JtN3bKM+XbRxW/33SpKto5iZ6qr5jnO2zEUYjw+vtbrZw1XA 0P/wTzGE+f2oiBgusBvZe0RkLJ+p6LA+qySyo= Received: by 10.216.24.206 with SMTP id x56mr373787wex.39.1236105733223; Tue, 03 Mar 2009 10:42:13 -0800 (PST) Received: from ?192.168.1.115? (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id d24sm7922480nfh.3.2009.03.03.10.42.12 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 03 Mar 2009 10:42:12 -0800 (PST) Message-ID: <49AD7A06.2090401@gmail.com> Date: Tue, 03 Mar 2009 19:42:14 +0100 From: Roel Kluin User-Agent: Thunderbird 2.0.0.18 (X11/20081105) MIME-Version: 1.0 To: jk@ozlabs.org X-Mailman-Approved-At: Wed, 04 Mar 2009 08:48:33 +1100 Cc: linuxppc-dev@ozlabs.org, Andrew Morton , cbe-oss-dev@ozlabs.org Subject: [Cbe-oss-dev] [PATCH] powerpc/spufs: negative size in spufs_{regs/fpcr}_write X-BeenThere: cbe-oss-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Discussion about Open Source Software for the Cell Broadband Engine List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: cbe-oss-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: cbe-oss-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org When stored in size_t size, the test 'size <= 0' does no longer work. Signed-off-by: Roel Kluin diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c index 0da7f2b..05dba47 100644 --- a/arch/powerpc/platforms/cell/spufs/file.c +++ b/arch/powerpc/platforms/cell/spufs/file.c @@ -569,7 +569,7 @@ spufs_regs_write(struct file *file, const char __user *buffer, int ret; size = min_t(ssize_t, sizeof lscsa->gprs - *pos, size); - if (size <= 0) + if ((ssize_t)size <= 0) return -EFBIG; *pos += size; @@ -624,7 +624,7 @@ spufs_fpcr_write(struct file *file, const char __user * buffer, int ret; size = min_t(ssize_t, sizeof(lscsa->fpcr) - *pos, size); - if (size <= 0) + if ((ssize_t)size <= 0) return -EFBIG; ret = spu_acquire_saved(ctx);