diff options
author | Krzysztof Kozlowski <krzk@kernel.org> | 2020-07-24 21:23:20 +0300 |
---|---|---|
committer | Krzysztof Kozlowski <krzk@kernel.org> | 2020-08-17 21:43:41 +0300 |
commit | 07b6cc4540d3f3f198b62efd73a43806f031b2d6 (patch) | |
tree | 06cbe7fb2603959134b1e4899be395ba2035fcf6 /drivers/memory/omap-gpmc.c | |
parent | 1724f1b6963a412d42696dd0d3c172fe983d1353 (diff) | |
download | linux-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.c | 3 |
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; } |