Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1378413 > unrolled thread

[PATCH 1/7] mmc: sdhci-pltfm: bail out if register resource is too small

Started byMasahiro Yamada <yamada.masahiro@socionext.com>
First post2016-04-14 04:40 +0200
Last post2016-04-14 04:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 1/7] mmc: sdhci-pltfm: bail out if register resource is too small Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-04-14 04:40 +0200

#1378413 — [PATCH 1/7] mmc: sdhci-pltfm: bail out if register resource is too small

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2016-04-14 04:40 +0200
Subject[PATCH 1/7] mmc: sdhci-pltfm: bail out if register resource is too small
Message-ID<rnFmh-2VI-7@gated-at.bofh.it>
This code checks the resource size and displays an error message if
it is too small, but still moves forward.  Let is fail in that case.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/mmc/host/sdhci-pltfm.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
index 072bb27..7d12203 100644
--- a/drivers/mmc/host/sdhci-pltfm.c
+++ b/drivers/mmc/host/sdhci-pltfm.c
@@ -127,8 +127,11 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev,
 		goto err;
 	}
 
-	if (resource_size(iomem) < 0x100)
+	if (resource_size(iomem) < 0x100) {
 		dev_err(&pdev->dev, "Invalid iomem size!\n");
+		ret = -EINVAL;
+		goto err;
+	}
 
 	host = sdhci_alloc_host(&pdev->dev,
 		sizeof(struct sdhci_pltfm_host) + priv_size);
-- 
1.9.1

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web