From patchwork Sat Nov 18 10:55:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 10064757 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DE5D660352 for ; Sat, 18 Nov 2017 10:57:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D56CA2A683 for ; Sat, 18 Nov 2017 10:57:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CA17B2A6C6; Sat, 18 Nov 2017 10:57:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C9A942A683 for ; Sat, 18 Nov 2017 10:57:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=SaZkxIM0LiJ/IzbpGnGI2UoLLo7Xm0ojqeiJcdvxqAY=; b=aC8CdcjcHmEE0EjB1+t65EITd2 N7ukyXbaraaJNeH8ofyfGi3i+DXeRKSjbEh1iC8G2cBDj7egvmCNYC4NQB/uDmREiqGAYb0aFOLgq TXq4WeuZlswHoUNd3YTqXV6O4lauPWj8CwYeq4oq/b+jj4f+mvIdIil7M4BPc7/mVotGbmEUyds0A 2Dwv5ch/hEWVnKT8fUsOTGD9bzSTYwEKfuA35i+4HA5nRQO3p5FcVQB+rxVNJBhKMOjyvAKWOHake P22QnXlc/mba0rPaAsGIa/n8bjw7Izgpb0/4IJEBB3F+9xBuxTmbd/O8xQAVIa0rIsrgZcVJw4Uro C6OTYe8w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eG0ns-0006O4-QH; Sat, 18 Nov 2017 10:56:52 +0000 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eG0n5-0005Vx-AK for linux-arm-kernel@lists.infradead.org; Sat, 18 Nov 2017 10:56:10 +0000 Received: by mail-pf0-x244.google.com with SMTP id n89so3815916pfk.11 for ; Sat, 18 Nov 2017 02:55:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=wo2RZfTQTaIyjh71E2i9Ok3zZ4My7t8LgsQ2jP+xuDo=; b=f7o77xrCB2l7Ko6je5L3AcjdTFFyBLB7YWBwpOmyOGWY33cDAv/JtOWaZbutWuqbzQ qgfuJp3qkkgyszC0W6J7H7xM0xctsARxFud1UliEzzD53j+pA7N1DWkBesBfeZMkhzyC eimnR2jVkGfLQNFrJQENa80BBqJuRJs50BLL/153mJ8eQ5aaK17hWUQgHdL/p5P0IN6c 3op/BIhVSXjA9KL4QDYe1OAy/sr7sLkixVD5a/Yx27bOZoh1VA+0h1k7rR4WpW8WxRZz TfetrZS6YKgBuDxUTlWMvm5NXZnyrLci8A9+vTvo6E6d0wP5eYvCqe/ayIysB3jAE6iX j52Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=wo2RZfTQTaIyjh71E2i9Ok3zZ4My7t8LgsQ2jP+xuDo=; b=FxJj8/BLJGPbcz89iMFo3VBtUgRpxIEO3RozCSN2nhlV+pMVdtSSkLJsqBlh1dQlcy LmAvp+2PjAp2LYVf402zoez3U+QF28TeYC1i1A+s6TmUM4R+gL0DtPWs1N6b/RFEH6bV dNIEWR4auVQAU5XbsKYzj33znBjAI+/rBq4bHrXLs/Ep/yikYW61bhMbec7gCU/YvNYf W5/ktsnJcVDNi05lId43pvbpdiG4i6E2CEc6W3tTbNkR5+5H+aFeqNkcFmaFhbrCL+7b Mrc86N846/Sk3FlQYnU92a6H1BQUe+NX/eTBrNqrbfre6sAmK7C2ZSoPpoMl8pxJLV9U BIHQ== X-Gm-Message-State: AJaThX44mVSom4Xewopv8Tl4Zf+RukwPDxUItt3cTUxnObMFpi9Unz0h Odzln5g3U0wbQghuHqNkcwo= X-Google-Smtp-Source: AGs4zMYaia+WjUe/bY0tGmB4jDFgMz5/SqiCp2jjNdGWubuoB1lkgEPa45VHXTQCBUARVoR//xNsVQ== X-Received: by 10.84.244.129 with SMTP id h1mr8044859pll.255.1511002547015; Sat, 18 Nov 2017 02:55:47 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id g7sm12321513pfj.13.2017.11.18.02.55.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Nov 2017 02:55:46 -0800 (PST) From: Arvind Yadav To: dmitry.torokhov@gmail.com, maxime.ripard@free-electrons.com, wens@csie.org, mcuos.com@gmail.com, linux@roeck-us.net, linux@armlinux.org.uk, lee.jones@linaro.org Subject: [PATCH 06/10 v2] Input: w90p910_ts: Handle return value of platform_get_irq Date: Sat, 18 Nov 2017 16:25:13 +0530 Message-Id: <1d35ad94214f0e0ba6cd50d443067c323121486b.1510999334.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: <76d6a73ba51e1a8a86d8d9a1d0bbbf7723d5153a.1510999334.git.arvind.yadav.cs@gmail.com> References: <76d6a73ba51e1a8a86d8d9a1d0bbbf7723d5153a.1510999334.git.arvind.yadav.cs@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171118_025603_704538_68ECEC3D X-CRM114-Status: UNSURE ( 9.11 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-input@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP platform_get_irq() can fail here and we must check its return value. Signed-off-by: Arvind Yadav --- changes in v2 : Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid. drivers/input/touchscreen/w90p910_ts.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/input/touchscreen/w90p910_ts.c b/drivers/input/touchscreen/w90p910_ts.c index 638c1d7..fa74f2c 100644 --- a/drivers/input/touchscreen/w90p910_ts.c +++ b/drivers/input/touchscreen/w90p910_ts.c @@ -277,6 +277,10 @@ static int w90x900ts_probe(struct platform_device *pdev) input_set_drvdata(input_dev, w90p910_ts); w90p910_ts->irq_num = platform_get_irq(pdev, 0); + if (w90p910_ts->irq_num <= 0) { + err = w90p910_ts->irq_num; + goto fail4; + } if (request_irq(w90p910_ts->irq_num, w90p910_ts_interrupt, 0, "w90p910ts", w90p910_ts)) { err = -EBUSY;