From patchwork Sat Nov 18 10:55:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 10064743 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 E875A60352 for ; Sat, 18 Nov 2017 10:56:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E13252A683 for ; Sat, 18 Nov 2017 10:56:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D603A2A7A6; Sat, 18 Nov 2017 10:56:23 +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=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA1FB2A683 for ; Sat, 18 Nov 2017 10:56:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946875AbdKRK4S (ORCPT ); Sat, 18 Nov 2017 05:56:18 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:45739 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1424107AbdKRKz5 (ORCPT ); Sat, 18 Nov 2017 05:55:57 -0500 Received: by mail-pg0-f67.google.com with SMTP id 207so3829448pgc.12; Sat, 18 Nov 2017 02:55:57 -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=aEpVYYrRiwoIrOLF80vjg6KyAUTRE9qQajEl1Tk3tJA=; b=oMGD4FJndkZ/OmNbHfrO0QAF9WTKVBp8HuzuUvtNcu+JDes3ppHtcLcX2ZUIRSn5k6 rX16vRMJO90qzBwy+y17vTb0ue6RI+keOxUfRAsawSU0Dt0RrzlARAMBzfGsVPxzNPSO RKr3OVR/dqelcJUmxzfH/6z3dxzlmCRMOL18L8qQM5YfO3NosiXazG/Z+ElEeB8WXcaP qZ1RVvN1qnQ9RqiVEB8TaNnKDuqzlUAeyE3QbuEvF065FqrlnPmi5QsBchhjEnUg68Kz BAdyLkErdsh0Lvdpg85oV4L0mPnOQJqtPm8LuLjjYshFCmZZgkEc2ABtKUmRjsRPyQU3 1Umg== 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=aEpVYYrRiwoIrOLF80vjg6KyAUTRE9qQajEl1Tk3tJA=; b=bERBVH038+Cjj8O7Sg9clnAiLyFlkVV+Vg4a2VKBAicWfPXhK9sbEiy1XKQ9z5y3Ts 77pUjfCK/Ucg+tbt4TP2u3GEvNZpdt2hHwCiXsmAz4ekr334K2WbuFNWDHPkPVE4a2b3 QNF1BYNz1f5PbbSemUvwyrYD1STDhtdJJ2qG3dVfrUDY0Org9dQmPgCX/wYPj1qIyyOv JQY++O+yA/ogAEWl0NAZbSHb5rsiYQhMRI8awOfLhu6Kpr8AcaikL9+FUQ0ejjITAFVj Nr5TI9oq4nQ9SWyC88FAdMVylNV+oYwgCKJd6nJIjGF+akXUDtHOg+oOeHicb1U35kkl S+zQ== X-Gm-Message-State: AJaThX7PckLm5t3mkgE5W8ELAAGNWFgzB7oXyxpviUDlo5wr43/ficL8 QvD+mMPX/XXcHGwer7XjLZM= X-Google-Smtp-Source: AGs4zMbBPfQY5N+t7tl6PmKjf4tcaM/QsxxNoaiaDWShGDLKm3d57B64hBSglCp6NfkXnOu3R7rp/w== X-Received: by 10.99.95.20 with SMTP id t20mr7593304pgb.398.1511002557176; Sat, 18 Nov 2017 02:55:57 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id g7sm12321513pfj.13.2017.11.18.02.55.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Nov 2017 02:55:56 -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 Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 09/10 v2] Input: sirfsoc-onkey: Handle return value of platform_get_irq Date: Sat, 18 Nov 2017 16:25:16 +0530 Message-Id: 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> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.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/misc/sirfsoc-onkey.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/input/misc/sirfsoc-onkey.c b/drivers/input/misc/sirfsoc-onkey.c index 4fd038d..de04b48 100644 --- a/drivers/input/misc/sirfsoc-onkey.c +++ b/drivers/input/misc/sirfsoc-onkey.c @@ -149,6 +149,9 @@ static int sirfsoc_pwrc_probe(struct platform_device *pdev) sirfsoc_pwrc_toggle_interrupts(pwrcdrv, false); irq = platform_get_irq(pdev, 0); + if (irq <= 0) + return irq; + error = devm_request_irq(&pdev->dev, irq, sirfsoc_pwrc_isr, 0, "sirfsoc_pwrc_int", pwrcdrv);