From patchwork Wed Feb 27 22:22:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 2194801 Return-Path: X-Original-To: patchwork-linux-parisc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id B08913FD4E for ; Wed, 27 Feb 2013 22:22:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750890Ab3B0WWa (ORCPT ); Wed, 27 Feb 2013 17:22:30 -0500 Received: from mout.gmx.net ([212.227.15.19]:54162 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750711Ab3B0WW3 (ORCPT ); Wed, 27 Feb 2013 17:22:29 -0500 Received: from mailout-de.gmx.net ([10.1.76.28]) by mrigmx.server.lan (mrigmx001) with ESMTP (Nemesis) id 0LyPqS-1UvYHq1vs6-015nBV for ; Wed, 27 Feb 2013 23:22:28 +0100 Received: (qmail invoked by alias); 27 Feb 2013 22:22:28 -0000 Received: from p54AD04DF.dip0.t-ipconnect.de (EHLO p100.box) [84.173.4.223] by mail.gmx.net (mp028) with SMTP; 27 Feb 2013 23:22:28 +0100 X-Authenticated: #1045983 X-Provags-ID: V01U2FsdGVkX1+8FEh9UyS8NJ3A9gFdpxX0d2R2RZDgZcpIXgDz16 AJV6YUgEx2H8UA Date: Wed, 27 Feb 2013 23:22:23 +0100 From: Helge Deller To: linux-parisc@vger.kernel.org, James Bottomley Subject: parisc: check return value of down_interruptible() in hp_sdc_rtc.c Message-ID: <20130227222223.GA2941@p100.box> References: <20130227221137.GA2806@p100.box> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20130227221137.GA2806@p100.box> User-Agent: Mutt/1.5.21 (2010-09-15) X-Y-GMX-Trusted: 0 Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org commit 42dfe13d133f945b49377c29b8c828205b231b4c Author: Helge Deller Date: Wed Feb 27 22:46:56 2013 +0100 parisc: check return value of down_interruptible() in hp_sdc_rtc.c additionally comment out unused code (which may be used later) Signed-off-by: Helge Deller --- To unsubscribe from this list: send the line "unsubscribe linux-parisc" 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/input/misc/hp_sdc_rtc.c b/drivers/input/misc/hp_sdc_rtc.c index 0b4f542..2e3334b 100644 --- a/drivers/input/misc/hp_sdc_rtc.c +++ b/drivers/input/misc/hp_sdc_rtc.c @@ -109,7 +109,9 @@ static int hp_sdc_rtc_do_read_bbrtc (struct rtc_time *rtctm) if (hp_sdc_enqueue_transaction(&t)) return -1; - down_interruptible(&tsem); /* Put ourselves to sleep for results. */ + /* Put ourselves to sleep for results. */ + if (WARN_ON(down_interruptible(&tsem))) + return -1; /* Check for nonpresence of BBRTC */ if (!((tseq[83] | tseq[90] | tseq[69] | tseq[76] | @@ -176,11 +178,16 @@ static int64_t hp_sdc_rtc_read_i8042timer (uint8_t loadcmd, int numreg) t.seq = tseq; t.act.semaphore = &i8042tregs; - down_interruptible(&i8042tregs); /* Sleep if output regs in use. */ + /* Sleep if output regs in use. */ + if (WARN_ON(down_interruptible(&i8042tregs))) + return -1; if (hp_sdc_enqueue_transaction(&t)) return -1; - down_interruptible(&i8042tregs); /* Sleep until results come back. */ + /* Sleep until results come back. */ + if (WARN_ON(down_interruptible(&i8042tregs))) + return -1; + up(&i8042tregs); return (tseq[5] | @@ -276,6 +283,7 @@ static inline int hp_sdc_rtc_read_ct(struct timeval *res) { } +#if 0 /* not used yet */ /* Set the i8042 real-time clock */ static int hp_sdc_rtc_set_rt (struct timeval *setto) { @@ -386,6 +394,7 @@ static int hp_sdc_rtc_set_i8042timer (struct timeval *setto, uint8_t setcmd) } return 0; } +#endif static ssize_t hp_sdc_rtc_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) {