Received: by 10.223.164.202 with SMTP id h10csp2383892wrb; Sat, 18 Nov 2017 20:54:28 -0800 (PST) X-Google-Smtp-Source: AGs4zMayLVNizYfa4mvHVwhQZI72rkhOMmznTCRMFrsXCzPvEzfvphUHpHXi6WlRZ/JgylVDa2jm X-Received: by 10.101.97.20 with SMTP id z20mr9551060pgu.267.1511067268416; Sat, 18 Nov 2017 20:54:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511067268; cv=none; d=google.com; s=arc-20160816; b=qn6F6w823saksWwHBWJ5s34Qc3CTk93lgo+Ip5hI9Fh6RFZ5NkjWVcoW6B25ZiDTGL RrgDFa3GXgYMWWsV/4oUBcTNOOyb32xVEWH5QErGen5lGQLaLS3Cxckg7fIdfKx9uyEf 6W/sqlUsiwn0CQZVluBTVgtCCZEQhkWNfOQoBBNHG7MxNiIIyGjgsMRF2v3yrHivMnns JO182JEGt2Tle/sM5uaK97dSKxnASD8yGWoqa9qurxwWDv3zRgk9B4+MXH4NL+2gP/yw Jq8+5kHG/q9M1J6r7mEOpcwt5QUsEenYjRNxeF8JUmTWiy5cyWvni5QUmYpEcTwmo+9S AqiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=LR3SA4ooCw1GMCFGWdV7oRYAqMdOBV1i+NVAg9VHZnM=; b=OnvMifufIvzP+/AdWw3JYcXXgnR0so0f5eWUu7IvW/e6cY/aQrvvCLXkDZEry0vKNl DhbQJqi98cEDlXcfWM2J9/vIoDv7EDyEEjNs9V6JUNKNeCjs/WaAHNPxAmIrTb8C0KN3 E5v8zWe9GzolWSUeL/ZEDz35VMUUhd92rOGf0+FXQPsB8NX+r7ViSmfjiR1mcgXCXjM4 DXGb3mQofUVdyeCsZIZGD0aWTvwP2fgXYAljpBEjPcVKn6iIUBwuqyR0MdmEhtrjNy5z yqIDbY4KQgxeieLgP5awpoR+whRkgTeOpx2VNW35zSRdXUihdiJ4Y4zvw63s5nJNO3Tm uqPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=l3zIMqWj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o190si5473475pga.827.2017.11.18.20.54.17; Sat, 18 Nov 2017 20:54:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=l3zIMqWj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751075AbdKSEx0 (ORCPT + 75 others); Sat, 18 Nov 2017 23:53:26 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:45541 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750950AbdKSExN (ORCPT ); Sat, 18 Nov 2017 23:53:13 -0500 Received: by mail-pg0-f68.google.com with SMTP id 207so4864145pgc.12; Sat, 18 Nov 2017 20:53:13 -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=LR3SA4ooCw1GMCFGWdV7oRYAqMdOBV1i+NVAg9VHZnM=; b=l3zIMqWjeAU3wbvdLLpDALv4yggXyt1ORAGCD2Vj9WbeT17sCsLUZrTOVj8BNpvZuD /KmnWd3I9FD2Fa+rfqXr2i6WGzpodaqfMiOM0VXNXxrLYxVdrosYkLseI+AHTs2DcnTc 6KURpERQiZCOTQ+Oj8vhBsTfGBCW9r5eX0g7lzF474GHLxBa/5XeiTEjSHZlHNmh1/zt dAn0WbHBGRPHb079P7Brk4ccHp+oFOo/58BMv9oHMiiUu7q6mE3X5L2zK54vCtPtFybh TIZSfQ8BWO7C+VE+cJW8NN545YS0D5G9YdjyFsE7eZXmugDU83Rez5l/8Ru8j888JQEc Q4sA== 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=LR3SA4ooCw1GMCFGWdV7oRYAqMdOBV1i+NVAg9VHZnM=; b=OFefWczJVT0vflAFN1PkwejuM3777iH2IYC1aRmvUdgDumEL/cVV5K86eVSDPoFAur AZr5/RRqB/NszQiUp+5WFY8opCKB3K2Ylzc57gEZoCL3fiEdxADnyLDA0TySmVFlzsyi WunyMmMJjlyRahawhaxbo8YzErtAR3EaeR3LqfuPziRZMwjpaKh5mFWtK1meld7HExF/ 3ybkTlXELEIdc1CGXNDnQCxMq1Dq+RFpMgqF3J/lH2xUzOzbAeHQduZSsdUJcsVQZTRL 3Q9xVkBrUQVdAMU0yXi1tKG3dAfrFpQUezNz9ezGDRPmqIWASJ0BuZpQ/oH02aO5hsQQ kB1g== X-Gm-Message-State: AJaThX4AtYazihh/9v098WDeJuy3YjPDHt63k9FqxlHi6pQUOlUH0KOn 4dSb8mXODxT0YlE0YOCszmY= X-Received: by 10.84.245.22 with SMTP id i22mr5838011pll.123.1511067192806; Sat, 18 Nov 2017 20:53:12 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id j79sm2312952pfe.129.2017.11.18.20.53.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Nov 2017 20:53:12 -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 Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org, linux-amlogic@lists.infradead.org Subject: [PATCH 4/6 v3] mmc: sdhci-spear: Handle return value of platform_get_irq Date: Sun, 19 Nov 2017 10:22:46 +0530 Message-Id: <23382b551ade00543aadc588aa74b0648958b907.1511066652.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. changes in v3 : return -EINVAL instead of host->irq. 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..e04485e 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 = -EINVAL; + goto err_host; + } host->quirks = SDHCI_QUIRK_BROKEN_ADMA; sdhci = sdhci_priv(host); -- 2.7.4 From 1584575527154843239@xxx Mon Nov 20 09:09:42 +0000 2017 X-GM-THRID: 1584467718411670387 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread