Received: by 10.223.164.202 with SMTP id h10csp2352914wrb; Sat, 18 Nov 2017 20:01:41 -0800 (PST) X-Google-Smtp-Source: AGs4zMaC3TxTc4390JUA/a7NoYSzqBmD9slQlAdPp2rUs2QO/i4Fn9VNu6Bj2Fj2cZDN8e31nwjK X-Received: by 10.84.168.35 with SMTP id e32mr10015584plb.294.1511064101448; Sat, 18 Nov 2017 20:01:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511064101; cv=none; d=google.com; s=arc-20160816; b=BI+Kdmye2roaoHrqW2WEZ66UMtUiydK7xN4VPCJfFZiFWqUx13gwQWO/u9v6VQgd3l KC+YhyaNlMByBVPmf9AqnS1CtsaLfV3V8mbc264MbJdwcjLagertl15Y+FowfO/ATzUb BfGtoG+cfTPIFImt83vFJseQvDY6Opc6wdgYywbOknzp/ps82BFLPGn0YeCVrIhTvxMG NU0r1Sn1DRLR731wJ1zUAVYLNuxP2NdQwcy9RxnKBu0Qs1nYwQEfqXBZXc8uzwlWPAMw OeNnHS+Qmm/M+74FIAddZ6641EWSfRaiHzT/ieOIVAo5FCG00pmEHWcoarkKs01unOur 3wsQ== 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=Hog8Z63fV5rGelSdRwBiCu6XOIXMBYBhVz8IOZbSl8k=; b=sQQx47+YKTWG77ECPQkYPXikaMmO5vgzHKq4jn++bSvHwRXecajLB/Yq1Gse3M6FHf dT0oBzonyGxqg+e84Ms5FgaU7jYARPqctHzfgN6JwOgKlHnFrwRDk725UNJ1wE+4pYF8 ervZtsgtv1c+E4vsmZVvOVFML9ijZjtOIpCUgl2geV/oX0RcW8BykZ/QqGWO5Y71wsXL In4QFgzKC59qq8jhdjd+PW8yp5eMyFchWrM6ysF30XCBXeeaeIJbpn5O6SZmKwHXCtGn a+XCFZIyCfyhv0tRpy5CCDcIjAVVINVs4KTzy+dKD97sRFxhix2nt+bc1+Ipwoe3lvOs nIHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fMQqtxUP; 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 q3si6072310pfl.322.2017.11.18.20.01.28; Sat, 18 Nov 2017 20:01:41 -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=fMQqtxUP; 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 S1163572AbdKRK45 (ORCPT + 93 others); Sat, 18 Nov 2017 05:56:57 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:34504 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1946661AbdKRKzv (ORCPT ); Sat, 18 Nov 2017 05:55:51 -0500 Received: by mail-pf0-f194.google.com with SMTP id x7so3836122pfa.1; Sat, 18 Nov 2017 02:55:51 -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=Hog8Z63fV5rGelSdRwBiCu6XOIXMBYBhVz8IOZbSl8k=; b=fMQqtxUP2affoLBR/I2eR+qa1kO0/rXhJPnh0/OVZ5NhQWZqtHii8JYXhOWqMHiLny mtbs4UYTAEQtpKHAnzCxAKk2bgWzGG7KU05b7K2sQg4DXdntAzUpYZDfvfH3ZrErNkES aRHsgG2sxH1JY8K0MjTWIigN798bsXEmc3Xx+4jjTxa+qSkb0swJkECXIGKbkacEX8V3 rijH07L4JctCtQduXfDzamgnb10hF3tq9xfWwJvnCTVQXO6vE5aJ67PQIm2qr6H8Wy/z SM64BP9drDFu5xLG82X+8miOpSs1PaldfFWAk/HVA12Ez+uzKwCFM+xRxyUPekxbphTJ r1Rg== 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=Hog8Z63fV5rGelSdRwBiCu6XOIXMBYBhVz8IOZbSl8k=; b=EaVyYD2srdNI5Y0yxmMei4DeBrspCapcewe5GJ3Wp/Y7adjormf3bKL2hzDOFEDNNc 61Jf8KRLxSdFAviWIeuhc/YJdVs3Hg991Yc9MUH5UC3ZOsms/ovTkimIr+McafzNATXV y/fHx0g3lGzsxgdhmx7Nc5FACBX09PafHoeI8gAAYsGm3tmAozb/7UnvDIfmjhJilf/Y d5LzYINkOYUfQbq/rUFnPwp1aAidzDOnNadRTOOAk1lr4lYaeK2XGp0R5acwBJ4t9k8B SXyeY/mExIh0QAzQ78iBi1k2kWyStf+NwCZm2MwNeGHI6m3T1ejHt31s/sdCTFes3KI4 OI5g== X-Gm-Message-State: AJaThX4v7EG2tSFw9GjBNoETwqskzsoHFyFUAfCxBVrATCpmg5JEFVlJ 1LUMTOZgyHcM4rc4R7ox8pY= X-Received: by 10.84.252.10 with SMTP id x10mr2123651pll.216.1511002550344; Sat, 18 Nov 2017 02:55:50 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id g7sm12321513pfj.13.2017.11.18.02.55.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Nov 2017 02:55:49 -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 07/10 v3] Input: sun4i-ts: Handle return value of platform_get_irq Date: Sat, 18 Nov 2017 16:25:14 +0530 Message-Id: <184c9420c0824fe60df98db0922762e3abfb2e05.1510999558.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 : ts->irq is unsigned. used int irq variable. changes in v3 : Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid. drivers/input/touchscreen/sun4i-ts.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/sun4i-ts.c b/drivers/input/touchscreen/sun4i-ts.c index d2e14d9..315f26b 100644 --- a/drivers/input/touchscreen/sun4i-ts.c +++ b/drivers/input/touchscreen/sun4i-ts.c @@ -251,6 +251,7 @@ static int sun4i_ts_probe(struct platform_device *pdev) bool ts_attached; u32 tp_sensitive_adjust = 15; u32 filter_type = 1; + int irq; ts = devm_kzalloc(dev, sizeof(struct sun4i_ts_data), GFP_KERNEL); if (!ts) @@ -314,7 +315,10 @@ static int sun4i_ts_probe(struct platform_device *pdev) if (IS_ERR(ts->base)) return PTR_ERR(ts->base); - ts->irq = platform_get_irq(pdev, 0); + irq = platform_get_irq(pdev, 0); + if (irq <= 0) + return irq; + ts->irq = irq; error = devm_request_irq(dev, ts->irq, sun4i_ts_irq, 0, "sun4i-ts", ts); if (error) return error; -- 2.7.4 From 1584231437051735781@xxx Thu Nov 16 14:00:32 +0000 2017 X-GM-THRID: 1584231437051735781 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread