Received: by 10.223.164.202 with SMTP id h10csp1218813wrb; Fri, 17 Nov 2017 16:29:15 -0800 (PST) X-Google-Smtp-Source: AGs4zMZrprFuGrW8NR1Ws9errvENmlhv0xQ/0FzWoda6UAgVS54XOBgCkhZ2ZX3JZVN+UDGxLn7A X-Received: by 10.84.130.34 with SMTP id 31mr6717856plc.241.1510964955132; Fri, 17 Nov 2017 16:29:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510964955; cv=none; d=google.com; s=arc-20160816; b=Csx7gq83HIoPA0CX5KDPRzVGgWsSDHXgAaayOXMZfu86HuKkmIpUU5hGWI7z/dVJpz oUHsxPNm0gt5uUGCVUjDql+jbf9nk0Sd83JossvZPnUf2t3w8+4SDa17qf0qkW7kvIq+ tSAIbVq/gVSb2LvNkAMQbYACG3i6Ivofnlj1hjmk+7m4YcHHycvXQah4S/1FCILUUnVM 2799AzT59LxOPBpwgorAdLlQfOqz2u/mOygwVxlV7vk+LnZW8UAqS2KJKYkhX3+7OJdR WI0TkVjFBQMqVewr931UvWpcgiBvoAGm5i7Fz4WyO1UZjBvXZ6MCaFv3qvOVTa+uhPEX rnnQ== 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:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=d3viQBAMeZkiwKRVS/CuL7SW/jIZPmEHRSwzUOSjE+w=; b=rJJFCsuytd9k+MNGwTTQe/pswtQS9oUvp22bifqrVacOgC1bBRG9aiUiUYIobEVDpk ZKyCyoFcP9ccLOfCDhJoaCM0ats1YkPkfTHmspV97+eEtQkKH6DjUy7qXMOO3QMz/qOH 1xgkUID5H5aDPsvqgn6gWWsgwGULRHt1jz8J+pI0Pb7u0hxjZpTV0hJsiVEDbyD3JtKs jSCPhPOSIj9bIicmRvRYx45xMMhs9/qY3eSUpVUiv+gixRM1hP4/NXN/4QmFNaXrHrcC q6isQvE/uOhkvMW+/Iq30YxiSWpiVNdAneDcwi8Ap262bC5L5lWGb7TxGRQX1IlILGPZ 4oHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BgkVxXNF; 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 j11si3562999plt.473.2017.11.17.16.29.02; Fri, 17 Nov 2017 16:29:15 -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=BgkVxXNF; 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 S966336AbdKQTSp (ORCPT + 93 others); Fri, 17 Nov 2017 14:18:45 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:35925 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935559AbdKQTQO (ORCPT ); Fri, 17 Nov 2017 14:16:14 -0500 Received: by mail-pg0-f65.google.com with SMTP id t10so2618796pgo.3; Fri, 17 Nov 2017 11:16:14 -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=d3viQBAMeZkiwKRVS/CuL7SW/jIZPmEHRSwzUOSjE+w=; b=BgkVxXNFL4QFH6keWSoUlcwcGHNoTnoU+vk4nWO0n8gJHsoNTZH43rccsXZi6BnJbC qyG4+ErhxsA70eh0uxbIbCfxI6quTxZLkNEXsxyq6uj6wPkLcv66RQDjljPSllxdw6pP 4lWCx+7Oe/EImTYWAQ44A/BjztJ9top6aa/jBUDeDbzMgzpoOUacKQfPYDmfaqhMikGr Cnpz65zc+4QzqMcQekkEWmSg/jOJoJvaxcGyNjldTQNVlx9mNnKWY04xXABzKvufOWao fU9Dpkh5mDa5JgACaG9Vp83Y7ny6r302AZeaQ9Q6kPX5B4nKCv00FCWreCQCxYCXekjL 6ADQ== 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=d3viQBAMeZkiwKRVS/CuL7SW/jIZPmEHRSwzUOSjE+w=; b=jE7we5f754V6i2K1kD+rWS4lNfCoLTWljpoWZIgPFb/sG8nEJ5J3QN3sjpYKR4RH3R zCQJW2IRkSw6Lz+YpQ1nuJFK8luXbXqhWb00nyeGV8RgQHN0NtVa9rUgkao0VT20fxcc srH0jQ6HrlpV6sprLl7CeO/AFHTx2yq0ktUSKRUon2681BbMRAeFsoYXpucz+WzNU+1X ehJrMpDT3/fjB0DN2gFrmhvwrtVfm6L6Z5rexWd7iHVmIgwbT10sYPAK1rHL/pFSU0ku hV63A2WtboDX+VsxC8wEuDoK+ca1khZ/WRSdaKmIYtbg2OwAIwO4t9ddCSbNWSS4aeKv kD0Q== X-Gm-Message-State: AJaThX78MsY2BNCojgW+5g8WBgoaJCHmAjQVSnL7N1MBQw48cwJmdNwf TElmtZvbMD32Byqw9f/B7Ik= X-Received: by 10.98.109.134 with SMTP id i128mr3139518pfc.66.1510946173449; Fri, 17 Nov 2017 11:16:13 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id u188sm7807441pfb.188.2017.11.17.11.16.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Nov 2017 11:16:12 -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 05/10] Input: cpcap-pwrbutton: Handle return value of platform_get_irq Date: Sat, 18 Nov 2017 00:45:27 +0530 Message-Id: <1510946132-13554-6-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-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 --- drivers/input/misc/cpcap-pwrbutton.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/input/misc/cpcap-pwrbutton.c b/drivers/input/misc/cpcap-pwrbutton.c index 0abef63..a4962e7 100644 --- a/drivers/input/misc/cpcap-pwrbutton.c +++ b/drivers/input/misc/cpcap-pwrbutton.c @@ -57,6 +57,9 @@ static int cpcap_power_button_probe(struct platform_device *pdev) int irq = platform_get_irq(pdev, 0); int err; + if (irq < 0) + return -ENODEV; + button = devm_kmalloc(&pdev->dev, sizeof(*button), GFP_KERNEL); if (!button) return -ENOMEM; -- 2.7.4 From 1584414854341099336@xxx Sat Nov 18 14:35:53 +0000 2017 X-GM-THRID: 1584414854341099336 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread