Received: by 10.223.164.202 with SMTP id h10csp2352867wrb; Sat, 18 Nov 2017 20:01:36 -0800 (PST) X-Google-Smtp-Source: AGs4zMYwCMgwcUj2+Xhxi99YyZned+XtCqmVQYCRsMbl4T04vm+n3PLt/lyBkvlzS9V0MVU7zhSK X-Received: by 10.84.176.65 with SMTP id u59mr10015678plb.21.1511064096457; Sat, 18 Nov 2017 20:01:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511064096; cv=none; d=google.com; s=arc-20160816; b=MZv5S279ZRF3djyczdei2rTJvZpHzc/37YuyE14oY8/r+CDG/kRf4jKMu6tCNpg5eD MtcTYBDlwNrUiZOyJiuIJ7T1eDQGoo9fWSapQp7FZDtcz6mK52wo8krwSviV1P4O7FCJ ysEKO92Ac6WN/i8D+j5MS8nxZZwTtfptQVhQOgJASmdCz8IGguGxqLbdZr305ejfgk8E VAPl4XConwmjWEA/rqo+UudyIxXg99Deu5TLBzUZvLSm4q+eU3NZ5ceaTI8Lht1jJgsx TXbFOsmzlgAD5qSxdvHpU+icElj6Pltw3j9ZerfM248YZ7875r5Z0uvfcxvI5pIjpzwq mLfQ== 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=tVNJF2IrneaqvIuTLo6rq7ur6y0ZiIqHnnDiMHzSprQ=; b=daFVKhQsDhALO4DLLNDgchYRqcai0oHWn86rZQ7pQP78sfYqS22h/3UXwH6L7AT/3D jwzRltaek7xoeR2cM2+gwaZfhU/zphFoXqRRrLlVVGpIKKZXD5oTTFPHHAdh8Gbrl9Bj 906olANs51rad1OHqW0chyeyKQOHLR6nJfP0fP1v35sHsDiER2jzLpLpnUAOM1Z5mcKo Mza2SN1IbD3xwZxGhFvcF4R2tgZp64IhxssB8ryGKpUcYjOocACsExMLZSDpPhv0Fq+m b/M0JL0k6WYGxZO8T8PIEbg/6HP/Ca65yrKNsgZ1SGDqZqILUDoEEw04s5Ag/jo+xlam 9fHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rbTvRZQa; 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 d30si5477341pld.506.2017.11.18.20.01.23; Sat, 18 Nov 2017 20:01:36 -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=rbTvRZQa; 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 S1947065AbdKRK4p (ORCPT + 93 others); Sat, 18 Nov 2017 05:56:45 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:44547 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1424073AbdKRKzn (ORCPT ); Sat, 18 Nov 2017 05:55:43 -0500 Received: by mail-pg0-f66.google.com with SMTP id c123so3830089pga.11; Sat, 18 Nov 2017 02:55:43 -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=tVNJF2IrneaqvIuTLo6rq7ur6y0ZiIqHnnDiMHzSprQ=; b=rbTvRZQa0qQoSziPhCRURyBiDRHJdtfJKt/7TORstU9umuGIlDm1xkWS5ngWLdafOC 4Q0qyQgVkgGGee/EQnhkyjivTZxJiC5hLHL4gHciL/B/Aj3DpSNUCLqpknHTtHKMkN1E /H5HvTsuzR4gqjH9AunQTlRE80dA2lnwaNdSJ37yunOqdSm1Wx58iTnULI2VOcEeH1HK d9nSW3deDwqTUL2g8aYDktky6DpUXk3nqXiuCf4svK/I+Im0g+fPJbTxza0lRaJeM1L2 uu1eCGwQAOFXtfVm5s98Sbl0OxCiIW4Efy9QUfb+2j+nz8jCEU5JvVaTrA0dKXbv8FiE jS+w== 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=tVNJF2IrneaqvIuTLo6rq7ur6y0ZiIqHnnDiMHzSprQ=; b=Rqe0CgPiVKKXAIFaaBNh6lJXo5pGq7bZ9zJw+2J+kJvtiCSt06O7+PG7k/gwtylDId aRY6138MsLpNF6XzEgzNn9kHh0uXzoSC8uDSZJrieN0V7aacDfctutWjd1QyeqFYgHvs VFMRPx3UECwrk9CR441FwO1kUMweVqKsiOaTHgqxfUbSkfVCbDZC3Gz1iecjeqgpjNIH gJGYym77ZfdwOP1c1NEOqHzTSZnMC/pgnFeaaOqJRDf19GDSWjU6Mo2Gy0Ir1zegJjJ9 4muh5ybS1x53ozde2/Cu5s7U6MXzM7SWmwSrla0h8cYCgSovXfp7vr3jFJVK9Yw9MY1Z bEEg== X-Gm-Message-State: AJaThX72HX2nvZM9PLkgchHObEii/sTAvguvX5oyrF8YyKz6ccSjpkEK PgOoAjFjZR6In6Y21ZB6/oQ= X-Received: by 10.101.97.20 with SMTP id z20mr7710240pgu.267.1511002543224; Sat, 18 Nov 2017 02:55:43 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id g7sm12321513pfj.13.2017.11.18.02.55.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Nov 2017 02:55:42 -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 05/10 v3] Input: cpcap-pwrbutton: Handle return value of platform_get_irq Date: Sat, 18 Nov 2017 16:25:12 +0530 Message-Id: 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 irq instead of -ENODEV. changes in v3 : Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid. 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..3a0626b 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 irq; + button = devm_kmalloc(&pdev->dev, sizeof(*button), GFP_KERNEL); if (!button) return -ENOMEM; -- 2.7.4 From 1584455862608923981@xxx Sun Nov 19 01:27:41 +0000 2017 X-GM-THRID: 1583410704181694636 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread