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


Groups > linux.kernel > #1351232 > unrolled thread

[PATCH] misc: sram: fix check of devm_ioremap_wc() return value

Started byVladimir Zapolskiy <vz@mleia.com>
First post2016-03-07 01:50 +0100
Last post2016-03-07 01:50 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] misc: sram: fix check of devm_ioremap_wc() return value Vladimir Zapolskiy <vz@mleia.com> - 2016-03-07 01:50 +0100

#1351232 — [PATCH] misc: sram: fix check of devm_ioremap_wc() return value

FromVladimir Zapolskiy <vz@mleia.com>
Date2016-03-07 01:50 +0100
Subject[PATCH] misc: sram: fix check of devm_ioremap_wc() return value
Message-ID<r9RwZ-3Yt-1@gated-at.bofh.it>
The devm_ioremap_wc() function returns either a valid pointer to iomem
region or NULL, check for IS_ERR() is bogus.

The problem was introduced by commit 0ab163ad1ea0 ("misc: sram: switch
to ioremap_wc from ioremap") and it survived after the recent MMIO
SRAM driver refactoring.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
---
 drivers/misc/sram.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/sram.c b/drivers/misc/sram.c
index 736dae7..9174623 100644
--- a/drivers/misc/sram.c
+++ b/drivers/misc/sram.c
@@ -361,8 +361,8 @@ static int sram_probe(struct platform_device *pdev)
 	}
 
 	sram->virt_base = devm_ioremap_wc(sram->dev, res->start, size);
-	if (IS_ERR(sram->virt_base))
-		return PTR_ERR(sram->virt_base);
+	if (!sram->virt_base)
+		return -ENOMEM;
 
 	sram->pool = devm_gen_pool_create(sram->dev, ilog2(SRAM_GRANULARITY),
 					  NUMA_NO_NODE, NULL);
-- 
2.1.4

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web