Commit 07b6cc45 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski

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: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20200724182328.3348-9-krzk@kernel.org
parent 1724f1b6
...@@ -1072,8 +1072,7 @@ void gpmc_cs_free(int cs) ...@@ -1072,8 +1072,7 @@ void gpmc_cs_free(int cs)
spin_lock(&gpmc_mem_lock); spin_lock(&gpmc_mem_lock);
if (cs >= gpmc_cs_num || cs < 0 || !gpmc_cs_reserved(cs)) { if (cs >= gpmc_cs_num || cs < 0 || !gpmc_cs_reserved(cs)) {
printk(KERN_ERR "Trying to free non-reserved GPMC CS%d\n", cs); WARN(1, "Trying to free non-reserved GPMC CS%d\n", cs);
BUG();
spin_unlock(&gpmc_mem_lock); spin_unlock(&gpmc_mem_lock);
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment