From patchwork Sat Nov 18 09:33:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 10064663 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 358A360230 for ; Sat, 18 Nov 2017 09:36:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2A1072A80B for ; Sat, 18 Nov 2017 09:36:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1ED7D2A887; Sat, 18 Nov 2017 09:36:28 +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 A59442A80B for ; Sat, 18 Nov 2017 09:36:27 +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=IDALiOewCFSDl5nOFtAmEjBsGocQNkJbmokKZc8Mrts=; b=TJpqOgqFvnaBusP9tGYLRfPZ6p iJW7Hc/bNlV7eytX/WKmDVli/a/ppuuZb+qIHukpPnGTHeaZH4r29aJBHkcb1CO9T2Gtt77giLI3B e8ntKPA4at7/k3e0SWrk7UkPWIICfeBMpyt72njIBslmcKy+vaE1nzrBt9iM9/u+J3V+okuCIiMU4 Q3lkxPYE19nz8S2ML5HcR79rpZwSRVUyA6vltyJ8Lvoeu5fP7GpIbA6dq4gfeuiJpztYtJ55xXa/5 dfWaSDMu6iWa0RxtsTUq0Au7T0acn5ZhbAcyzSxtduJzbuJeh+mlTZ0RDxBLxdtpRAwkkdUeln8Ul IQZdMGGQ==; 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 1eFzY2-000237-PX; Sat, 18 Nov 2017 09:36:26 +0000 Received: from mail-pg0-x243.google.com ([2607:f8b0:400e:c05::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eFzWa-0007mc-KS; Sat, 18 Nov 2017 09:35:01 +0000 Received: by mail-pg0-x243.google.com with SMTP id o7so3754485pgc.4; Sat, 18 Nov 2017 01:34:35 -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=Xz8EpN6YKCYpecnUoVD74o3uYtDvnulQicp3AhST55A=; b=WnXQ3/AQvk0DiVyGXnAGsq5LOY/j/Z/iKGdhiSidE8oMGOOB0jowmwqDhMbrA3NAfZ suIGR0iu0iMrG9kv9StxM/6C1sk4GfwRPSg7KosX7i9hq6RYWI7PamJe4BZFcNEtNziM 3Fqw9TqV4Xctu8xRuA/S0YXD/yBo0QHU5i3jCs876htd06aBw9ttGUSucqa+s+Nfs2Ch g3RafSroXIj6ODeb5FscPxGfjM9P7rS3lj7lWbdDzPquSvte5ojXZUde8j+MUT+FLZ2t Pa/kJ9RoZGIR4mzFeO0ai3trKIgAPBMgX0k4E+UsUfHyedjHDfvpH0E5/MXS/ZdrX+Kt cJrw== 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=Xz8EpN6YKCYpecnUoVD74o3uYtDvnulQicp3AhST55A=; b=rf/aekLhQOGA4UpaBlCLWgEpJC+hszY6USTqdyB2iH/OMMH7CiAu5yWAl9w8lkkJB8 00KEzLVLsr7PJ6sc3Oo11bLQxoDfyIOoV7JsrWAByo3VkA1hNbblEfMJ95nUSkL16Snx SC56I2gYVCy36Cn+LBOpbLtGIn23FO+buix5vxGtHYqbvH81kjAWEpnBoO/iXk0YB5rE 4ABqg9mkG/WHg1JnhTvU7FVwQqli3dgdx8YeGxLkFVMUHZqjGuxi0dT4pvaJ3DUkJMKC QVguLGG2pk7S5+xSB2NFKe+IDwILm3Yf7xbVL5KyGMhb151ojhlGyGynPykdkZ575ta3 F1ug== X-Gm-Message-State: AJaThX5yKW/IT8iL46jRP+Bg56Xc4rtAGxXBanxh0MaX93jhDRgSANYq RmCVvwNSESYYlUhqbcivo6Q= X-Google-Smtp-Source: AGs4zMYGfijPMO0ccUEMDw184/h0JfOpKFYQjXwmXy0pT3iIqgOOGYV4AbQGi7umO5wQ4AIIMbuZWw== X-Received: by 10.101.91.78 with SMTP id y14mr7755473pgr.220.1510997674593; Sat, 18 Nov 2017 01:34:34 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id y20sm11057079pgc.52.2017.11.18.01.34.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Nov 2017 01:34:34 -0800 (PST) From: Arvind Yadav To: ben-linux@fluff.org, ulf.hansson@linaro.org, adrian.hunter@intel.com, vireshk@kernel.org, maxime.ripard@free-electrons.com, wens@csie.org, linux@armlinux.org.uk, carlo@caione.org, khilman@baylibre.com Subject: [PATCH 6/6 v2] mmc: sunxi-mmc: Handle return value of platform_get_irq Date: Sat, 18 Nov 2017 15:03:48 +0530 Message-Id: <27a6d3a22516b3711b48bfbf305b6d8f3960eeac.1510997223.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <130df0c2c60ed6a0f460b68c586cc0a4167aed0b.1510997223.git.arvind.yadav.cs@gmail.com> References: <130df0c2c60ed6a0f460b68c586cc0a4167aed0b.1510997223.git.arvind.yadav.cs@gmail.com> In-Reply-To: <130df0c2c60ed6a0f460b68c586cc0a4167aed0b.1510997223.git.arvind.yadav.cs@gmail.com> References: <130df0c2c60ed6a0f460b68c586cc0a4167aed0b.1510997223.git.arvind.yadav.cs@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171118_013457_487100_2980D20E X-CRM114-Status: UNSURE ( 7.88 ) X-CRM114-Notice: Please train this message. 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-amlogic@lists.infradead.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.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 : Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid. drivers/mmc/host/sunxi-mmc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c index cc98355d..ec2a16b 100644 --- a/drivers/mmc/host/sunxi-mmc.c +++ b/drivers/mmc/host/sunxi-mmc.c @@ -1255,6 +1255,11 @@ static int sunxi_mmc_resource_request(struct sunxi_mmc_host *host, goto error_assert_reset; host->irq = platform_get_irq(pdev, 0); + if (host->irq <= 0) { + ret = host->irq; + goto error_assert_reset; + } + return devm_request_threaded_irq(&pdev->dev, host->irq, sunxi_mmc_irq, sunxi_mmc_handle_manual_stop, 0, "sunxi-mmc", host);