From patchwork Sat Nov 18 09:33:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 10064643 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 6322A60230 for ; Sat, 18 Nov 2017 09:35:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 57B8A2A682 for ; Sat, 18 Nov 2017 09:35:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4ABD42A873; Sat, 18 Nov 2017 09:35:33 +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 DE6492A682 for ; Sat, 18 Nov 2017 09:35:32 +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=/NfPXN42y7liIQ5CDPIQOYvl3/c9rbfJah+EX7DmQVI=; b=ptosCVh2O4mDgnTwVoNb1+HPJr Dnr6vjVnXgn2Hiob6oAQ0oxJ4IPLuGhbIoYclOMsKbu1LpfLZ7k/Sh9TrRcp0X2TSUA9mkxMGcVfM QE0K7CSdgf2stDAaO65TzMCn2UcRtkTjtgjBgKDgXLSKG9Jz09Sy4g8yqCYRDpDT7alul0Bsgg6BJ aOWg6fSIBlz/3AlFl7T8gvELCFBQFMZvkpU/wD1nwqIr+yoVEg61oKAGGcrODcAT4mvxHFtvlv6bW 7QtrNGJLDIn8F3QbadUCqw9Jf5F07p5eOvYXPwkfkjJn9sIb/1F36numiIc0mHJxNVRlzDJ/gbV+L i2FOP1yA==; 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 1eFzX9-0001KZ-Pe; Sat, 18 Nov 2017 09:35:31 +0000 Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eFzWL-0007hq-4j; Sat, 18 Nov 2017 09:34:49 +0000 Received: by mail-pg0-x241.google.com with SMTP id c123so3741149pga.11; Sat, 18 Nov 2017 01:34:25 -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=4vOcORNargIeGcZ6+TNWqh9eEWXI6i4yaqVVlLR8FeI=; b=JrvQjiR7OB+VWSdA7av8hJbJXEh5lSKq+LNV5wBWTetgExtazZQ6kaR6AsYHW4SlRl PjcuV/GXDN6yimwb/mHVZDDQikLOqENbcdTTJ//Eov6FJTsW6Vc3/J6pAJc4v+20xJAl AsjfJ5o7isLSbKHjHvf29XVr8N9eMdNxNfAvfOoEdpnoBgX1hhK2aJzjLh1r1Jx6lU5t KPthAouDu9qlp2fYWv7io1094mG86XkDTFMM68nUoxJN5dRLedIrCzLdYgsXeaRBgbxl wYBnOkG5mfrM2wLWR2iOAN++ozHHGWq61lq5G1GYQ2iJGTOuRY8vDzBhbjxetOc6EwoJ zm+g== 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=4vOcORNargIeGcZ6+TNWqh9eEWXI6i4yaqVVlLR8FeI=; b=kht848e+cILCedCSU09yqcmXBiSenptoKHmg753XKKuJrfi9gD4C0KJVUL6KPH7sdE MZSvsvbX+bplMWtYXaXULoMBZGBK07fOKZT0VHlb51MtWToyzAGKS+Wl5FZ2Fb5K5qq4 IOslJlKpDO7VJg2l+A8N6uS9U+TExMOFK225CwneNAu1b90ltfcwAWaXzhe2qudhNefP DkQlaU1bvH7QE+qWIKc2xFHCh+N9lc/AZBuDg10evaIyDgiovcAUEcxLS9pshiLUw0om rbed/VmcRPHl3OIOWdpVYpM9NdCfSygTeR2ccRgfJZZ09IAgpfEDjWEtaPbzXlvhGMP5 Mg6Q== X-Gm-Message-State: AJaThX5QdcAg6rzJPMBLccZZKmpM6uz8prw7BHxzqycFzaGnulk1POJy jKZ2CeCYx3O41J6hiknzHDU= X-Google-Smtp-Source: AGs4zMZYBK20iqOHzOzBfNbQC1w0ZeDFTUwR402jWrpqWGHXNnTHKojVkIBYaZititSdrUHGzwaKag== X-Received: by 10.84.128.197 with SMTP id a63mr7879873pla.212.1510997665231; Sat, 18 Nov 2017 01:34:25 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id y20sm11057079pgc.52.2017.11.18.01.34.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Nov 2017 01:34:24 -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 4/6 v2] mmc: sdhci-spear: Handle return value of platform_get_irq Date: Sat, 18 Nov 2017 15:03:46 +0530 Message-Id: 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_003486_A3BF2AEC X-CRM114-Status: UNSURE ( 7.39 ) 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 Acked-by: Viresh Kumar --- changes in v2 : Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid. drivers/mmc/host/sdhci-spear.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/mmc/host/sdhci-spear.c b/drivers/mmc/host/sdhci-spear.c index 8c0f884..900838b 100644 --- a/drivers/mmc/host/sdhci-spear.c +++ b/drivers/mmc/host/sdhci-spear.c @@ -82,6 +82,10 @@ static int sdhci_probe(struct platform_device *pdev) host->hw_name = "sdhci"; host->ops = &sdhci_pltfm_ops; host->irq = platform_get_irq(pdev, 0); + if (host->irq <= 0) { + ret = host->irq; + goto err_host; + } host->quirks = SDHCI_QUIRK_BROKEN_ADMA; sdhci = sdhci_priv(host);