Received: by 10.223.164.202 with SMTP id h10csp1556586wrb; Sat, 18 Nov 2017 01:15:03 -0800 (PST) X-Google-Smtp-Source: AGs4zMat4d2WAywjg0GuJKBJ7h3WDZyOY0S+GahnZ0cPnaaK+aabtAevzvLifcy6SkvBNY45/ANE X-Received: by 10.84.215.131 with SMTP id l3mr7900945pli.181.1510996503023; Sat, 18 Nov 2017 01:15:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510996502; cv=none; d=google.com; s=arc-20160816; b=H5g2MsIzFt3h0FWCJs8D9GN9cxGpvvxGhjhkKG2UUDL+PY5XA2XJfRhPDdzIf1HPTG OAOXI+0+GF4hVxYeGTvrbiWt0PfSKY6yy52g87RPid+58GEnmTso+9+21+BNfEFXIORP xoMbAS2irQfMIbpFoPvkJRMVKKTiZQwxC1v/t+eZaRJJVbmixfyXWXOUvO/YYqPZm1v+ FcbwriIsrNdbBphkJDC4THE2JGVw9OFuNyDHAH6tsoimlyhIMXFzszMJwZWzf2Zke4+c CFywxEYjpYSw8DTD0W2kQQjJ+iAEmsKnYkEBW54hd0RA5bAUjA2Hk/6w164Iq4Kyq94o JQ0g== 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=/6+mZ34l60s/19xpNUtYMTG4veNnMdKoaCXGas2KEzs=; b=CCY8Wj2YQNCxlheZfhC4eb9keKdQkFpYVbUAH2I5Vt0Y6ljemuKaEBKTDVGQ4GPmms Ez18RUSSkqz7Bn4aLnUDCZi1X2QJ3cTwikIEk1aqDCiMJb6Sm8/zSpkL/x5mgvSOF7HE 7SZOvarvK0mhfNPaCbDvqqdqKN03gsXZU2qSbnBCtZsZKVrRCPx/WyZ94b4rmfCh2aUe zSY3d9E5URXnyN7sGnXs56WyUljJw9yr9zwTIC4xbBLt/pzh/oQol/RThyQa2Jhkn84p S5ghNfNOh0G2kAqEwIIYYu5Vep8h782/cunWg+sIms1c3lkmYLrltnIp+C3VmUoWpXrE SKjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KNo0c2Rn; 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 j8si4186871plk.775.2017.11.18.01.14.50; Sat, 18 Nov 2017 01:15:02 -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=KNo0c2Rn; 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 S965630AbdKQUYT (ORCPT + 93 others); Fri, 17 Nov 2017 15:24:19 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:40529 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161776AbdKQUUW (ORCPT ); Fri, 17 Nov 2017 15:20:22 -0500 Received: by mail-pg0-f68.google.com with SMTP id u3so2724573pgn.7; Fri, 17 Nov 2017 12:20:22 -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=/6+mZ34l60s/19xpNUtYMTG4veNnMdKoaCXGas2KEzs=; b=KNo0c2Rn6K3YnVCUwUolZs5J0XEd9T5y5EK0KUMK6kpCUTLZKQ9OUxphR5CKIOmoZR jOUekHbXP+bA6yPkDByMTrM6hnD1+KjW12Il/0KMVwLfPPyjr1KY9AunNubNPdF8COlN BI7ywVVW4ICIrjE0NQNq4Jm3BpBTLTWph8uCnT4X8PuV0K4+LROkjltYJnf3BinLTlOM 7M20WmkePrteZQKhrh5JdJyecjaRje1YXZ4jKBi1j/VDApjQFBm1IDQ9Kq1I5j3xkuBg 97m9tbo1CblMfEe8pzw2ghPWKKIayD0JpEnZCNmO58jgbYUfpkqEoUh1BDiSIqQ76Tn5 aaAw== 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=/6+mZ34l60s/19xpNUtYMTG4veNnMdKoaCXGas2KEzs=; b=OgFLxmqSM3jUePCj5nArpBEIi0zhJacSrd+I48U3g4rFtevVZIFI9qr4ILhXZX+r6y xpTeYBaW7TG0jRVq8vJmuehgKCZyzokUflDxfjCYFsCiovvEXgn0Guc78QFnQS+xOeW/ m3gMSnEcTfrwuOyf/cVqZA21jrUw6kwpPXpeeIdFXK7zMLbSU99YFWpMjhTsyHDj05HY v79E9n0DhfjG0jPtmIclFHd+obPo2rcLEtKWRAJzaHdVsag0fel1FUq/HNJejRQJk7B+ Ji69Nt2Qb1VV7sLOdZTv1jaLeCu7gHMt5Ys36HhtuIaFoqxXkcZmijvrWi/vTkHMSqFO PNiQ== X-Gm-Message-State: AJaThX7hskgLyaBfSD5rZVFgrCcFlBjib4z3IjyaSCInQKK3PM+hS+iD Yzyg26N2v7x/g1JqhpfrVxo= X-Received: by 10.84.132.34 with SMTP id 31mr297574ple.395.1510950021823; Fri, 17 Nov 2017 12:20:21 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id i3sm7674715pgc.88.2017.11.17.12.20.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Nov 2017 12:20:21 -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 8/10 v2] Input: twl4030-pwrbutton: Handle return value of platform_get_irq Date: Sat, 18 Nov 2017 01:50:03 +0530 Message-Id: <5a63dbd55d3d61de6b0a5c530172ea6ff6f85462.1510949239.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: 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 : return error insted of -ENOMEM. drivers/input/misc/twl4030-pwrbutton.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/input/misc/twl4030-pwrbutton.c b/drivers/input/misc/twl4030-pwrbutton.c index b307cca..64e7d4b 100644 --- a/drivers/input/misc/twl4030-pwrbutton.c +++ b/drivers/input/misc/twl4030-pwrbutton.c @@ -58,6 +58,9 @@ static int twl4030_pwrbutton_probe(struct platform_device *pdev) int irq = platform_get_irq(pdev, 0); int err; + if (irq < 0) + return irq; + pwr = devm_input_allocate_device(&pdev->dev); if (!pwr) { dev_err(&pdev->dev, "Can't allocate power button\n"); -- 2.7.4 From 1584488112198415288@xxx Sun Nov 19 10:00:17 +0000 2017 X-GM-THRID: 1584488112198415288 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread