From patchwork Mon Jun 22 20:35:59 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roel Kluin X-Patchwork-Id: 31834 X-Patchwork-Delegate: tomi.valkeinen@nokia.com Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n5MIZTI4020177 for ; Mon, 22 Jun 2009 18:35:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751512AbZFVSfZ (ORCPT ); Mon, 22 Jun 2009 14:35:25 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751522AbZFVSfZ (ORCPT ); Mon, 22 Jun 2009 14:35:25 -0400 Received: from mail-ew0-f210.google.com ([209.85.219.210]:45091 "EHLO mail-ew0-f210.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751512AbZFVSfY (ORCPT ); Mon, 22 Jun 2009 14:35:24 -0400 Received: by ewy6 with SMTP id 6so4932636ewy.37 for ; Mon, 22 Jun 2009 11:35:25 -0700 (PDT) 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=GItZJ+v91BQU6XnIoORnZ/psdFuh6yGK0Ev+90oC5ZQ=; b=WSww8eSa55ELhe5hX10Y8+sBSGktPsTbTyukdMNJwBjBTdFOBIEGvDRV+Bf3PTXsQ3 zD/YF/u3JTlcS24J6EtrpQMbdc1V0+NJ7n5Gg3wVZScUH2Ws4DRsYi38LX3i7Kh6Qg4r 2WK848cLTGJF9jB3Hxkq0x4I7tXFRDh6jtlB0= 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=HTUSBbRikDWr9ekCMsBqXS3VxECqmmTS1eG0FqJ3ts6tvPArJvch9VYfwzLvH3/sPj +6qn57G9TaFtqx3uujmuVUo2n0S1cwzPHYghbxffG61wOmLyjnM5DLg6e+7JqvrMntWm /2grjcrYsKNqVZJv4bZ2CLKYShZgHlIp+Ai1Y= Received: by 10.210.128.17 with SMTP id a17mr5209463ebd.51.1245695725589; Mon, 22 Jun 2009 11:35:25 -0700 (PDT) Received: from zoinx.mars (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id 10sm31846eyd.37.2009.06.22.11.35.24 (version=SSLv3 cipher=RC4-MD5); Mon, 22 Jun 2009 11:35:25 -0700 (PDT) Message-ID: <4A3FEB2F.8040307@gmail.com> Date: Mon, 22 Jun 2009 22:35:59 +0200 From: Roel Kluin User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Thunderbird/3.0b2 MIME-Version: 1.0 To: imre.deak@nokia.com CC: linux-fbdev-devel@lists.sourceforge.net, linux-omap@vger.kernel.org, Andrew Morton Subject: [PATCH] omapfb: invalid test on unsigned Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Unsigned regno cannot be less than 0. Signed-off-by: Roel Kluin --- Is this correct? please review. -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/video/omap/omapfb_main.c b/drivers/video/omap/omapfb_main.c index 060d72f..787271f 100644 --- a/drivers/video/omap/omapfb_main.c +++ b/drivers/video/omap/omapfb_main.c @@ -276,7 +276,7 @@ static int _setcolreg(struct fb_info *info, u_int regno, u_int red, u_int green, if (r != 0) break; - if (regno < 0) { + if (regno >= info->cmap.len) { r = -EINVAL; break; }