Message ID | 1345555932-13737-1-git-send-email-lars@metafoo.de |
---|---|
State | Accepted |
Headers | show
Return-Path: <rtc-linux+bncCLPB5bXaBhDknc6BBRoErLHGPA@googlegroups.com> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-wg0-f56.google.com (mail-wg0-f56.google.com [74.125.82.56]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 204502C0094 for <incoming@patchwork.ozlabs.org>; Tue, 21 Aug 2012 23:36:40 +1000 (EST) Received: by wgbds11 with SMTP id ds11sf1917531wgb.11 for <incoming@patchwork.ozlabs.org>; Tue, 21 Aug 2012 06:36:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=mime-version:x-beenthere:received-spf:x-synserver-trustedsrc :x-synserver-authuser:x-synserver-ppid:from:to:cc:subject:date :message-id:x-mailer:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-google-group-id:list-post:list-help:list-archive:sender :list-subscribe:list-unsubscribe:content-type; bh=snp6lNo+aqaITTfdjH/Uu27yjud9EBRcBeq1CmcSo9E=; b=AzKzrzCS3pCPBJ7HtpvmMkfJgwOxVwEbWkjYmiJh2X/x3gLh+OgEyJLj8ULroO9QHW HuQhEViNB9I3aqZO95Izb3Ly4cB4WiG8AnsaGUOG/j4hKzGUAR4f/EMfvr/ckBMlpnrr k9/+Egl+FtRDnf3CslIozaxI06V6sa35cSFEI= Received: by 10.180.105.163 with SMTP id gn3mr1347726wib.0.1345556196979; Tue, 21 Aug 2012 06:36:36 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: rtc-linux@googlegroups.com Received: by 10.180.103.170 with SMTP id fx10ls5425817wib.0.canary; Tue, 21 Aug 2012 06:36:36 -0700 (PDT) Received: by 10.216.234.135 with SMTP id s7mr1016791weq.8.1345556196485; Tue, 21 Aug 2012 06:36:36 -0700 (PDT) Received: by 10.216.234.135 with SMTP id s7mr1016789weq.8.1345556196472; Tue, 21 Aug 2012 06:36:36 -0700 (PDT) Received: from smtp-out-188.synserver.de (smtp-out-188.synserver.de. [212.40.185.188]) by gmr-mx.google.com with ESMTP id i17si3906923wiw.0.2012.08.21.06.36.36; Tue, 21 Aug 2012 06:36:36 -0700 (PDT) Received-SPF: neutral (google.com: 212.40.185.188 is neither permitted nor denied by best guess record for domain of lars@metafoo.de) client-ip=212.40.185.188; Received: (qmail 3914 invoked by uid 0); 21 Aug 2012 13:27:45 -0000 X-SynServer-TrustedSrc: 1 X-SynServer-AuthUser: lars@metafoo.de X-SynServer-PPID: 3845 Received: from ppp-93-104-164-93.dynamic.mnet-online.de (HELO lars-adi-laptop.fritz.box) [93.104.164.93] by 217.119.54.81 with SMTP; 21 Aug 2012 13:27:45 -0000 From: Lars-Peter Clausen <lars@metafoo.de> To: Alessandro Zummo <a.zummo@towertech.it>, Andrew Morton <akpm@linux-foundation.org> Cc: rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org, Lars-Peter Clausen <lars@metafoo.de> Subject: [rtc-linux] [PATCH 1/2] RTC: JZ4740: Fix IRQ error check Date: Tue, 21 Aug 2012 15:32:11 +0200 Message-Id: <1345555932-13737-1-git-send-email-lars@metafoo.de> X-Mailer: git-send-email 1.7.10.4 X-Original-Sender: lars@metafoo.de X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 212.40.185.188 is neither permitted nor denied by best guess record for domain of lars@metafoo.de) smtp.mail=lars@metafoo.de Reply-To: rtc-linux@googlegroups.com Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: <rtc-linux.googlegroups.com> X-Google-Group-Id: 712029733259 List-Post: <http://groups.google.com/group/rtc-linux/post?hl=en_US>, <mailto:rtc-linux@googlegroups.com> List-Help: <http://groups.google.com/support/?hl=en_US>, <mailto:rtc-linux+help@googlegroups.com> List-Archive: <http://groups.google.com/group/rtc-linux?hl=en_US> Sender: rtc-linux@googlegroups.com List-Subscribe: <http://groups.google.com/group/rtc-linux/subscribe?hl=en_US>, <mailto:rtc-linux+subscribe@googlegroups.com> List-Unsubscribe: <http://groups.google.com/group/rtc-linux/subscribe?hl=en_US>, <mailto:googlegroups-manage+712029733259+unsubscribe@googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1 |
diff --git a/drivers/rtc/rtc-jz4740.c b/drivers/rtc/rtc-jz4740.c index 05ab227..1224182 100644 --- a/drivers/rtc/rtc-jz4740.c +++ b/drivers/rtc/rtc-jz4740.c @@ -42,7 +42,7 @@ struct jz4740_rtc { struct rtc_device *rtc; - unsigned int irq; + int irq; spinlock_t lock; };
The irq field of the jz4740_irc struct is unsigned. Yet we assign the result of platform_get_irq() to it. platform_get_irq() may return a negative error code and the code checks for this condition by checking if 'irq' is less than zero. But since 'irq' is unsigned this test will always be false. Fix it by making 'irq' signed. The issue was found using the following coccinelle semantic patch: //<smpl> @@ type T; unsigned T i; @@ ( *i < 0 | *i >= 0 ) //</smpl> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> --- drivers/rtc/rtc-jz4740.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)