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
This commit is contained in:
Krzysztof Kozlowski 2020-07-24 20:23:20 +02:00
parent 1724f1b696
commit 07b6cc4540

View File

@ -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;
}