Received: by 10.223.164.202 with SMTP id h10csp1540353wrb; Sat, 18 Nov 2017 00:52:13 -0800 (PST) X-Google-Smtp-Source: AGs4zMaIhGIMKlU5/+7wYSTR6ZXl4qvJ1AG0Nm3lTU5vB1WMmwBfUitLY487ARo2vbP0Buy1LScv X-Received: by 10.98.209.8 with SMTP id z8mr4746878pfg.184.1510995132962; Sat, 18 Nov 2017 00:52:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510995132; cv=none; d=google.com; s=arc-20160816; b=YulGAsBpa4N78BgV57WDS7YVz7U/HsT7Dtu1idfgziBJqWTDEwFgfmOvX6OqU0rNaM kRA9Ul4+hRLqSTFaGQaGzGt4lmK8Ov2aHybwlzKZk65XLpidPWr1kPFhdaXjIlCWkbn3 fx11wmKp3R3mjhPy5C8lr8BVh1GWcyDOrjflONZ2KbtF7a+zv52DFsdcP00XwCvaLP2S KoxAu/0yCFsgnQAd4pbMdbKWySdtamX0f3csszHalyZkm18igIu68NzIYW6CiHXjvq+g XCw3Imu6fmwz7PiDXcRqRYDvoiKe1q6kHhXirWY6OarBYes1+Z0vG76WPWXPREE2s7rq i9+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=L3gpO2dDyZPATMBZ9hX0BDSkrJW5mNq6O+iVpw7Jdgk=; b=gnVLzXWZbEZFbjQK5f9TbbTalSF0EE3aimRZUkT92bUjMXNBwOkYW4TsnrHOQCLdrI Mvr3CQ+i6TD2+wyaDaP4Jjshi5fP1iHT8V9aP8Be4lsmFJu1e8oFrEBEIjVDiDza9aag UUFfvtJH3uD4EpLnkKvorg4OfeJ/LIk/TV491eKhdpmDJ5EyCkOqvi0qkwKn3O7bOHEd JqeJvv1RHSX4xlkfKgu9NZF2iMwx2NvaBMKC3Uaipawa5TIdVSGOV9No4dNjCRtClSkL AYAj0KBI92WkIGW/BUeX4azZ0kypwkx/raBKgZk45TrMzXE3Z9vCXlXdjcOIfE8RTdcV fraQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Z6yho61l; 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 m1si4134300pgq.230.2017.11.18.00.51.59; Sat, 18 Nov 2017 00:52:12 -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=Z6yho61l; 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 S1762095AbdKQVHN (ORCPT + 93 others); Fri, 17 Nov 2017 16:07:13 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:43715 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762079AbdKQVHG (ORCPT ); Fri, 17 Nov 2017 16:07:06 -0500 Received: by mail-pg0-f66.google.com with SMTP id r12so2793800pgu.10; Fri, 17 Nov 2017 13:07:05 -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; bh=L3gpO2dDyZPATMBZ9hX0BDSkrJW5mNq6O+iVpw7Jdgk=; b=Z6yho61lCCtOZY3JstMHWLtPI7tzCHz5Z8nOJ1srbs0wEn40mIF0yoIVG8w2vyP18L zhiRSVAEzLmKb/5fzlQm8VMPAJZQHkzSBTxUP1hBeSjlln7xHT0lJEfW2XrnD8rejnhX 747WzVsOVubDs51RsebC4oiJTDy8lVI75aUP3A+w8IJ4+nMdztmLNpRkALb7JXNt1uGT YG0e4PT536EevlbrmT345YCG52qA+gMTrI0exoPd/n01YpKh8xuoQJP/jDkukPBUPuum 4nq2muTIjBi4RIdFG35fAaKWGaWjNcqqbLgcgBGIIrKYAL4Z95zutaZhoBCGhBhQTv6/ 8G8g== 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; bh=L3gpO2dDyZPATMBZ9hX0BDSkrJW5mNq6O+iVpw7Jdgk=; b=PYIJ5vUXPJwLFoXiZayELG2l6bMzbeMe8e50TPWjPoZgLqqEm5J/n9wzzNsPDNcejC S4XnRQ6IpMTuDZwvY2kttWnaqhiJEw9fgM3n/ip/mAG4TuNvMZuXbasA6boJjT0zqFW/ Vv4bRiFJYPKdCDlVPbwAGD+VxQ525fJcVEvkFTFcFe74+egBi2KA00imjeVT7iagsZGK WIakam4QHlTkjxj89xNafDnHgINUF6SJl1K8UXjXNRmikUMTyY/BVPZzS7JoBuBuSztY y7DXU0rKvaYG73IWv16IRCU3tqgw4vgBN+FRherfFbYZGxhy/8rHaC3f+CDAurxgkncv OYbw== X-Gm-Message-State: AJaThX5s+hbF2pY/9f46au95/bGaWsZhqajFGj53MAhmMDmA+hOt1arp rOFHuy4rTwUozS67y7X6DUg= X-Received: by 10.101.92.66 with SMTP id v2mr6198563pgr.151.1510952825566; Fri, 17 Nov 2017 13:07:05 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id a81sm8959411pfe.32.2017.11.17.13.07.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Nov 2017 13:07:04 -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 5/10 v2] Input: cpcap-pwrbutton: Handle return value of platform_get_irq Date: Sat, 18 Nov 2017 02:36:53 +0530 Message-Id: X-Mailer: git-send-email 2.7.4 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. 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 1584361588789709667@xxx Sat Nov 18 00:29:15 +0000 2017 X-GM-THRID: 1584361588789709667 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread