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
Родитель 1724f1b696
Коммит 07b6cc4540
1 изменённых файлов: 1 добавлений и 2 удалений

Просмотреть файл

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