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: 10063787 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 857156023A for ; Fri, 17 Nov 2017 20:34:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 768102AD93 for ; Fri, 17 Nov 2017 20:34:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6A8802ADB8; Fri, 17 Nov 2017 20:34:13 +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=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F15F62AD93 for ; Fri, 17 Nov 2017 20:34:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=eS1EnuzORTl6ZqW3GCbB9O2v7uPY8ZTG5FSGw5Sy3Is=; b=tFnbPhFOAcncOt/xmxdf20Yxdl MA2M5ba3KEcaFr1tK2tmVrqXDZ/CujUeGGRIyW9WoI5+yVgk2yCVK1fCDYL4tg553H42/tGgGqVq6 wIMB7mZXLG2ookqGdfk52KjnLxTS0P1eptfDbAazWvKuGfm5+k2fFueV/65OBmVDx8wwYgG+c2SgV peCODNCsX9wcbE4kudvnoW6rVtzYY1UnVpPWxvM3y0Znyr1QwLCf9sQWZnY17ZPTisgAZpxJkTWC0 LH2dkweCJKfcV+h0WJC/AQwcWsSLLjqhlULdqOVphGxEwGtLpGz3Szg/oqXQQvn1x+P+yTWkqYqkV rMVYUoVQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eFnKf-0003MP-9H; Fri, 17 Nov 2017 20:33:49 +0000 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eFn7v-0001mf-J5 for linux-arm-kernel@lists.infradead.org; Fri, 17 Nov 2017 20:20:42 +0000 Received: by mail-pf0-x242.google.com with SMTP id 17so2690635pfn.12 for ; Fri, 17 Nov 2017 12:20:18 -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=agU5Qk5b7FG5NOqU1F4i3tVbtbppQyNXatXFoL1kzO1SKSFqlLJqqiHXxTkrOpq8/Z lvx86LmkQyAAPK4qLZUxNuuf5JZ+zmlCsck2o1htMLnE1Sn1kYMsJ87dudurbs/qm1YC pBm4ECWsjv5dawEOOUJLFuXz2djJZ1rENZdCtLJeyKfRLuKkLLxCJRP/2lLIg5WaHRxk FYIIWdFG5tVe6PcIZBtKR5M/KIL4I3LsamrVXSA/i7WhcJ/90l9iJxzg7NlnxewDAkRx PZ4zuaqaxru5hvBgvVjdr0Y9hkWfgzgcQ2UYmhKCc69/eaTWmfbcFSn2xAYwsxI/3+7o 4v+A== X-Gm-Message-State: AJaThX5isJO2yG7Al8ATn3Gvg//nBKeolGGZQoXCl7r9Vtf24DTmbW0d g25BVeS/s+iSmEb9RMiubDc= 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 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: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171117_122039_787561_69359EDC X-CRM114-Status: GOOD ( 10.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-input@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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;