Received: by 10.223.164.202 with SMTP id h10csp2354055wrb; Sat, 18 Nov 2017 20:03:27 -0800 (PST) X-Google-Smtp-Source: AGs4zMYAvSu9IfKKGuJLcOFNiKkX9xiBlbv/gUbSZvYciQyh0qYCN+wcMyQwRWlY8rqbIdbprTIx X-Received: by 10.84.137.106 with SMTP id 97mr10042354plm.429.1511064207355; Sat, 18 Nov 2017 20:03:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511064207; cv=none; d=google.com; s=arc-20160816; b=EGlqPU8DyBts32jMHm+AJ+6pKPNcXmooWY6cSPW1WTCkYZZQazNP3gIBxCAqDOXCxH j119RSShq5l7QmbpX7PtYjd9IOld1Nf4/iLOAJf+ozaLl41nK/oBpLa1I0JngavfLf13 ZF7Uqpl7Hs4tHqFCtrMwB+ZezlTdxTSiJgGMQ8MbmYIvzsh1A4U639oOIgXE1ls+Mh1z Gu6emuZabBeJW0sZR0EpnH2k8TQ4/VQSnIT4fm7N9LIxvvlERjyhbSxDXGaeblu/Y69C f34zUaoMg0+4mZEHGvbzbUO2uJNQMlaGYIXdt1pwoK4w0/VeIuxKIH4s23nv6DySCr/Y yWLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=B44O+Lbh679FkscUR2rgCQar37m3LHJplvS8yVB7rO4=; b=GlKMdv0CSKQTKxW0vvZjC30xDiRv9W5E5XUB18weOBtVCfg1KznlpN40gftqh/KLnM tPWnDPFAORnep0z8o0zmOlqfhcmogMjiy7VJc1gctbpbScOLupKDkwcHajezvLOddxW7 vKRG/md0nrgM0W4ZDbvqumIXoU7gZd2I1dKeoM0AEf7F9fP0W7sCcdOa9wIfnohiKaCU uXXoCzpuvMUkKnABgemQpnVmSCmiP2VccDCev1XhRX7SBnh88/huU2qNMCRLhusq9E31 w5b0sLRD5R/dro3peh4olUsPkkdjLX7L5YcQJ33IPE7/3sBVVMXMFKsrVdo1m8oESQJi LLBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IukAnqND; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q15si5477732pgc.21.2017.11.18.20.03.14; Sat, 18 Nov 2017 20:03:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IukAnqND; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1764707AbdKRK5p (ORCPT + 93 others); Sat, 18 Nov 2017 05:57:45 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:44563 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1424128AbdKRK4B (ORCPT ); Sat, 18 Nov 2017 05:56:01 -0500 Received: by mail-pg0-f65.google.com with SMTP id c123so3830339pga.11; Sat, 18 Nov 2017 02:56:00 -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=B44O+Lbh679FkscUR2rgCQar37m3LHJplvS8yVB7rO4=; b=IukAnqNDAUQRQ4+BLth6xnnEiBJYPtW4cNPCZTOSCgbKJIRGTdK+7MYDJF7c2w1VXY G+cb7Voa5KHUnHejNug8oJHib9qy0BqapmeBUVOzpu0qYYCVKGXnte4zgk0CwZuKpbnw G0orjYxmLcEXFF0/8Iw3z9Co4PnxdTCNKGIOIx+N3AiBAvpC9Jbudj98Nkp3Q1C+kf4K vw62wgjSnRwThDHLUmbk2YZqAcnDklseGLaAfTooGlpnSDuSbVLnh2xQyZPMugB6M6AW RpAN5Cnmf3rSneNdtOwHv+8Z4iBQiRNbqfLDWl+5fEaa/sSpdLzQjLoT48ievWHZiJoi PfJw== 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=B44O+Lbh679FkscUR2rgCQar37m3LHJplvS8yVB7rO4=; b=l3xow5eR3M7WnhBI9cfv+hIIm9N392z0BslmOd12lPLb1g8WAZNOrID2Z7v4lsCYeY 8BQYjpWkcW35lIhVHmJ1+/3UxR/QxxxtscIlJdquli8pz21VMzNa7VdkSzu2gnqMtsxn eTkjQmChztbrfIeY/8NIrwbfOMCq88wM+tMKviTejEABX5yS3hdmqts9HPTtX1/mwwxh jfffhOlDVPuwrJ1QEpycjXVZnrsHK4M5I8aj4Wck5Qz3XchpyPkpRdFyprPrTDJkw/Et /rQP+qFSG9ZhEIRIhbMWFzISGEwG2QthxUH7A2UTQ7jo+yrttnGo6nZaB49XL5LO3dtK m2bw== X-Gm-Message-State: AJaThX6ovFmkSsvVj94R+sEkLBzBDZ5vSPQCiTVqHjMAmQ7hwW5H443g e2Cuh9P5atCrQCPwMSNkQF0= X-Received: by 10.84.168.193 with SMTP id f59mr8020184plb.22.1511002560593; Sat, 18 Nov 2017 02:56:00 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id g7sm12321513pfj.13.2017.11.18.02.55.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Nov 2017 02:55:59 -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 10/10 v2] Input: palmas-pwrbutton: Handle return value of platform_get_irq Date: Sat, 18 Nov 2017 16:25:17 +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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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/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 | -- 2.7.4 From 1584610847004088533@xxx Mon Nov 20 18:31:06 +0000 2017 X-GM-THRID: 1584610847004088533 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread