Received: by 10.223.164.202 with SMTP id h10csp1517179wrb; Sat, 18 Nov 2017 00:16:51 -0800 (PST) X-Google-Smtp-Source: AGs4zMZTYN4asWohtZssbu026SeCzPPH2VdMNLZ/bVjTJjNiKguK/fen7+L0S7eQzU9Xg4K7R7Ge X-Received: by 10.159.244.20 with SMTP id x20mr7859080plr.433.1510993011211; Sat, 18 Nov 2017 00:16:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510993011; cv=none; d=google.com; s=arc-20160816; b=vz9S9Ytb5pXKzNcwwS/GhdahhSDoPRUrT5aHUm/Kty+j3xn5LB8UB2lQKTEmOuSoA7 MEFdRMH6llEKP+vFhXB8zPqFWRRX9gIIoBvl1JO8yddqBjIbJqIJxUi9lJi059hIKTeC iIWiyIMpjxmHii5WsIdM+uozj6gAMxqB2zOb0KPgGDMk1YgFGsVxSMHEawWshzzG/6Ze Ew5p5VZQXo9j8nLnVR2UJYjIUZk/P2SNzGOV4TEkZsGscxk+BkuTXugLSzIGxXQnQMlC hTyRkR5U12dctETUtoOTu+zo3iZGz4br4WJUa8Is5m1uRSsU2N/Ro1eRCsWCrx0o5JcT t/rw== 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=pvnOeJ0rKHtTrQlMjvxUKSnQ72YntJls/eYLjWz6Ivs=; b=sdY7PmWQ8ZismHJN1G4mdcQqWYO+EJybnklej9PHpZsAH6tVLwqDzKluRCDEWOQkdk o8kics67HuNRNDgIswf/8POv7P4ycwGeNNvxQXz71/AAyt0T84/FI29+VpGAobZWv03h RwbgwvAdbnOklpWGuOce9OTIbpuoTz1n7EadFM4ooyCW17T8Kb9K3frykCyet3ldOHi6 jKToCEuW/IZhTO0M8U1zvwamghKiBl9fporGZ4QvFM411rkTuzPzKT/S+4/2lxtTZQNU /FKnFL3U6VDUe7imwhEPNWj8IMpwI1OKpOcoPp82TpLM7yErh2Jb05kDdC4X3XARcCF3 JqzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DQjYZl18; 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 102si4209034pld.614.2017.11.18.00.16.38; Sat, 18 Nov 2017 00:16:51 -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=DQjYZl18; 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 S1751102AbdKQUYy (ORCPT + 93 others); Fri, 17 Nov 2017 15:24:54 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:41913 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161772AbdKQUUT (ORCPT ); Fri, 17 Nov 2017 15:20:19 -0500 Received: by mail-pf0-f194.google.com with SMTP id j28so2700006pfk.8; Fri, 17 Nov 2017 12:20:19 -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=pvnOeJ0rKHtTrQlMjvxUKSnQ72YntJls/eYLjWz6Ivs=; b=DQjYZl18KO2by4xrLBXhF21Jlk4F8bmb31LG76zMuixTGD7NxCHFQBMxOwpaxIFy1i vQiP0Bv0Vts+vYhK4xa38Y+nS3575eVdi8wPmTahSc41cQr6+lZcg34IAvQqBFOb7s2M HkgTYCgqEr8md+fOi8w1Z9PJYUNYfngoqypImB5sKdE3ReFO9V3S5D2aO/uubqcQHSj8 SpJkfCsmOMpFF3UDkGb2OJoTsEVHVPE7kX1WPnrglDmOa3u/WevKiOi5IlZ7wFreVEj1 oEPmaBLWxX3WV42dIUeEWbO8ry6a0JEeOMEsTTLVCvPMtf+ro4u2PrsJWftH2qISG+nG eniA== 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=pvnOeJ0rKHtTrQlMjvxUKSnQ72YntJls/eYLjWz6Ivs=; b=TAypmMZoP0hM2gfPtmhDEN+50ktAlQfyzsYMR2xBlczfTA+sKaoXiqlyrLxZxeY45b KfVMF2EF1UIUp1SUzja+V2auleHrJlQZy/D4/BOH1cquvApNNrgXaSvDWrRnuhEC3+Mo YS1Sw/NDtaDRxFjlQEx8VutzKcmIvDIhLuxI2pAnRjUPyaDIskyODguVI55sh/JRTKVV v64o6sXgZQlKvHNjDAwemT8GuT9ZP14GzUBOmrcZR7kAkrw4H5ygRN+V146GUl0blK6d foiitPH0LtATUKC2kluj0NORQwcv8mZ5iziRkTX5/9Uy6jDLA20h48fMOR5I+Y8V27h/ EURA== X-Gm-Message-State: AJaThX4hSPwPKwxN/zplSiIg2oSTIET4up8m7+BF/8/DTAF6KyqXsDon jW3jr0956Ab4IUn3/b2KlPE= X-Received: by 10.101.72.132 with SMTP id n4mr6161634pgs.245.1510950018581; Fri, 17 Nov 2017 12:20:18 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id i3sm7674715pgc.88.2017.11.17.12.20.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Nov 2017 12:20:17 -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 7/10 v2] Input: sun4i-ts: Handle return value of platform_get_irq Date: Sat, 18 Nov 2017 01:50:02 +0530 Message-Id: <184c9420c0824fe60df98db0922762e3abfb2e05.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: ts->irq is unsigned. use a temporary variable irq. 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 1584442464756103676@xxx Sat Nov 18 21:54:44 +0000 2017 X-GM-THRID: 1584442464756103676 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread