From patchwork Fri Nov 17 20:20:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 10063675 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 15FD8601D3 for ; Fri, 17 Nov 2017 20:25:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0840C2A211 for ; Fri, 17 Nov 2017 20:25:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F12712ADB9; Fri, 17 Nov 2017 20:25:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B3992A211 for ; Fri, 17 Nov 2017 20:25:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932689AbdKQUYh (ORCPT ); Fri, 17 Nov 2017 15:24:37 -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-Google-Smtp-Source: AGs4zMbjpq2C2YdBN4THaanTAXmAlIQnMBRGvIybFyv4ltPkooyZWnxogkTxjXyoYI+7bPEb9WbYaQ== 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-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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;