summaryrefslogtreecommitdiff
path: root/drivers/memory/omap-gpmc.c
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <krzk@kernel.org>2020-07-24 21:23:20 +0300
committerKrzysztof Kozlowski <krzk@kernel.org>2020-08-17 21:43:41 +0300
commit07b6cc4540d3f3f198b62efd73a43806f031b2d6 (patch)
tree06cbe7fb2603959134b1e4899be395ba2035fcf6 /drivers/memory/omap-gpmc.c
parent1724f1b6963a412d42696dd0d3c172fe983d1353 (diff)
downloadlinux-07b6cc4540d3f3f198b62efd73a43806f031b2d6.tar.xz
memory: omap-gpmc: use WARN() instead of BUG() on wrong free
Since driver tracks reserved memory, freeing a non-reserved GPMC should not be fatal and crash the system. Printing a warning is friendlier. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Link: https://lore.kernel.org/r/20200724182328.3348-9-krzk@kernel.org
Diffstat (limited to 'drivers/memory/omap-gpmc.c')
-rw-r--r--drivers/memory/omap-gpmc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c
index 2ef2a7a8ed51..76a9c700cbd5 100644
--- a/drivers/memory/omap-gpmc.c
+++ b/drivers/memory/omap-gpmc.c
@@ -1072,8 +1072,7 @@ void gpmc_cs_free(int cs)
spin_lock(&gpmc_mem_lock);
if (cs >= gpmc_cs_num || cs < 0 || !gpmc_cs_reserved(cs)) {
- printk(KERN_ERR "Trying to free non-reserved GPMC CS%d\n", cs);
- BUG();
+ WARN(1, "Trying to free non-reserved GPMC CS%d\n", cs);
spin_unlock(&gpmc_mem_lock);
return;
}