From patchwork Fri Nov 17 19:15:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 10063433 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 91A496037E for ; Fri, 17 Nov 2017 19:17:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 823022ACC5 for ; Fri, 17 Nov 2017 19:17:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 771E52AD86; Fri, 17 Nov 2017 19:17:05 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, 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 21C412ADA0 for ; Fri, 17 Nov 2017 19:17:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966338AbdKQTRD (ORCPT ); Fri, 17 Nov 2017 14:17:03 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:45514 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161650AbdKQTQd (ORCPT ); Fri, 17 Nov 2017 14:16:33 -0500 Received: by mail-pg0-f66.google.com with SMTP id 207so2602697pgc.12; Fri, 17 Nov 2017 11:16:32 -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; bh=s19NXlc2O5xMktXXNKCj276h4+5/Io7l1Fe2phUbGrg=; b=LWuVjXyWTOrKkkme7pgRSGCjcGeO5rjj7PYOkzS5X6vHJ5z3DNE949/f75gy4byiaq f0SFTs9Z4AxI4wydOuFZj+/2Uo1sqYhyVLEOUEVcxVe7jB0YV7rmHsOv0AsvjgX34GYX vT909m9RX/Z1j0m9idreFoRV41es1TKhsQNcbwNSUu8o7AMA/8/36Os59mYRiKsTEblB V/7Fgc0ht/le53KeA/Ip//CEyEL/afAl5So1nPEEVHJxUFWJMwdJ6WAScmnIm5XDR6Z1 q1p9TdeKlbhlx1lmf1pgEsTu5lnBX6MFNh216OFr4SHxiWE07yuqqacBRMX3m8nylY10 ET8A== 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; bh=s19NXlc2O5xMktXXNKCj276h4+5/Io7l1Fe2phUbGrg=; b=ZCO4Uj/U0dReZP6c5/eqrT0DYs9BH6isMYMp8UqQb/cDDHLQx6A77aWM1K59oNMuBQ sMNYx7ElUjeGsCo3u4x+gppnkbAjKz9j6K8SVOa5movIgoWDZY3lehWkNAVTrM3Sj/pL +vZRxkaC74InmoHixgaeS+KRyyxpy2xRiyAewvOA5ryr45x2Qglou2sZZ1uSL9B2TWT+ cjtSEbzNc+U9ODSmaGgngVtjpCh0SMIaxWgeCBNeCbVx3fOu2ue/7ucewEtwq5Mug8Ji ibTxn46pIf4HVJyIzoRvRlNmARuiGAx/TK5AMdi8+HlQyo1C095f7uTvqXhppg7w2uIA mnfQ== X-Gm-Message-State: AJaThX4IpzWezEU8um7eWKVLwj3PfbLu9yWwrGJkJfhsRpkmbxnJ1tUj 9lNjoZQsiL7s4R2MoPqnjEA= X-Google-Smtp-Source: AGs4zMbGoweeBRMEGno8smb2kEyEGoYxvf0fGrKsSgyDQR0Nnz80EwrGSSmL0/WYX9iAeoDQqjRlcw== X-Received: by 10.98.212.12 with SMTP id a12mr3081169pfh.164.1510946191175; Fri, 17 Nov 2017 11:16:31 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id u188sm7807441pfb.188.2017.11.17.11.16.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Nov 2017 11:16:30 -0800 (PST) From: Arvind Yadav To: dmitry.torokhov@gmail.com, maxime.ripard@free-electrons.com, wens@csie.org, linux@roeck-us.net, wsa@the-dreams.de, daniel.thompson@linaro.org, mcuos.com@gmail.com Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 10/10] Input: palmas-pwrbutton: Handle return value of platform_get_irq Date: Sat, 18 Nov 2017 00:45:32 +0530 Message-Id: <1510946132-13554-11-git-send-email-arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510946132-13554-1-git-send-email-arvind.yadav.cs@gmail.com> References: <1510946132-13554-1-git-send-email-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 --- drivers/input/misc/palmas-pwrbutton.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/input/misc/palmas-pwrbutton.c b/drivers/input/misc/palmas-pwrbutton.c index 1e1baed..f9b05cf 100644 --- a/drivers/input/misc/palmas-pwrbutton.c +++ b/drivers/input/misc/palmas-pwrbutton.c @@ -210,6 +210,11 @@ static int palmas_pwron_probe(struct platform_device *pdev) INIT_DELAYED_WORK(&pwron->input_work, palmas_power_button_work); pwron->irq = platform_get_irq(pdev, 0); + if (pwron->irq < 0) { + error = pwron->irq; + goto err_free_input; + } + error = request_threaded_irq(pwron->irq, NULL, pwron_irq, IRQF_TRIGGER_HIGH | IRQF_TRIGGER_LOW |