From patchwork Sat Nov 18 09:33:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 10064637 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 49CF260230 for ; Sat, 18 Nov 2017 09:35:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3CC9C292B2 for ; Sat, 18 Nov 2017 09:35:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2E8382A706; Sat, 18 Nov 2017 09:35:07 +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 B72F1292B2 for ; Sat, 18 Nov 2017 09:35:06 +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=u4LfPvJKJ1XnGsZaIdrNJvGdvD0+noPV4jnP8jrGnxQ=; b=urFwCSoPVwu7VOpAXAjs4qh2Oh RztdfBiQ0PpqbIqEqt0rF48RElgysnO8VjUssBX74ZYBLLDvpy2xOn+svrfZA8TEEXywFIY8cpbPp 1WQEiNxgOCKLoww5loMOL96Q3PME920n9RVa1XEknFLXxC5WTnXwaMHMVt2iNNyQYu2lgp7PBSDW3 +HnAhd6TOj/aSEy8QHPoqNlhVt/ezXrWs2eyZC1xu6gfIX3mU6zxQq/AzjhcADs0Iff/p0p16wFUw ZwxNrVJv8gXyRbfYrC2W/wH1TUwMB+I3kI6uN9M2CfZuXAoNGZhKsuM/FSHX+fzB8pvT5YOsQ0PVf Rnbqa1Ew==; 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 1eFzWj-0008IK-7U; Sat, 18 Nov 2017 09:35:05 +0000 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eFzWK-0007hT-W4; Sat, 18 Nov 2017 09:34:47 +0000 Received: by mail-pf0-x244.google.com with SMTP id l24so3736412pfj.6; Sat, 18 Nov 2017 01:34:20 -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=7diEQdukoqCSV/Ord4kqC5aBKutrfMQfvn4l3kYqiKw=; b=i/A9UyUXCTQjuXg+eSAwIx/rCZmJ0v2FZUKrU/ZvPeGETJDUxu+AgW4wU0jvszF+Fv rWKgIFEgwZOAS5/IsQOb1hmMhX5odUqHoyfvsUEyHmyRh7NpgxWuwMVcuik8r6wp4itG Uj45WY7dKERhGbZEG+oM+UhLJsJdR5g51jDXgTq8S/fCefnHyc2+ICb0+VeX5ZIReL98 MHYC81Hwib817poLBUbMKB2vEPR/rPldI3w1syJ6WD6SzF9zXLgjXyVYwQ+mlr2Amc+m EyyXcQWoP2wsIxrrlS5LAPxgEoi1ii4p7i3GLwmSKWSDEpvTCMgSUwiXRfV5oYO/nlSh UgzA== 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=7diEQdukoqCSV/Ord4kqC5aBKutrfMQfvn4l3kYqiKw=; b=EAq/BwTFZSJG0QjBqvPC/DhispTA4D4bTF36OGKk+QGVLXTP8Oj9WHxR0uGAK5c4+M z5Z/KIL0dpLzcXqgZPJ9tzSluu0hdIDKiNIVgENff7exwjN84HwddAd+59kcIcWaWEMh uVIHYwIVQWvrQx8nsnXTLymcJZmfxoCE/Zr7dZHWHw/j69oPDMcuCxuHS7Q2pzFOhXx0 5DSr5a24YTByccht7ntEUKGDAjAWNgSESzKM807PVz07nIG3cwLyKHVHdTa2qiKBLJX9 408D+rLFFOUhB9WqyIv+iYtgY5Xn2zQQZTCHBC5P/fs5XXPSDCNb2SJ4L1LYWsQeqVd3 VykA== X-Gm-Message-State: AJaThX4IpCOgoz5ACJwI7vjKxTu6gLvwmUALnoDoPw1bNvEGEDvZYo/j MC7xfwRJy2kiUSUH7o4Fr7E= X-Google-Smtp-Source: AGs4zMYj+hA2/ZnpxeFi4Kos7Qd5T/t7BYNqsTsWRr7/OquosYRsGKtVBcrqBmtdRM7LF+bKJZHA/w== X-Received: by 10.101.66.197 with SMTP id l5mr7765785pgp.240.1510997660091; Sat, 18 Nov 2017 01:34:20 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id y20sm11057079pgc.52.2017.11.18.01.34.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Nov 2017 01:34:19 -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 3/6 v2] mmc: sdhci-acpi: Handle return value of platform_get_irq Date: Sat, 18 Nov 2017 15:03:45 +0530 Message-Id: <293914dcf01ddafb7669ab0212c8651071be95c9.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_013442_178746_CA1667AA X-CRM114-Status: UNSURE ( 7.31 ) 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/sdhci-acpi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c index b988997..dd8129e 100644 --- a/drivers/mmc/host/sdhci-acpi.c +++ b/drivers/mmc/host/sdhci-acpi.c @@ -566,6 +566,10 @@ static int sdhci_acpi_probe(struct platform_device *pdev) host->hw_name = "ACPI"; host->ops = &sdhci_acpi_ops_dflt; host->irq = platform_get_irq(pdev, 0); + if (host->irq <= 0) { + err = host->irq; + goto err_free; + } host->ioaddr = devm_ioremap_nocache(dev, iomem->start, resource_size(iomem));