Message ID | 20200724182328.3348-9-krzk@kernel.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | memory: Further cleanups | expand |
On Fri, Jul 24, 2020 at 08:23:20PM +0200, Krzysztof Kozlowski wrote: > 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> > > --- > > Not tested on HW. > --- > drivers/memory/omap-gpmc.c | 3 +-- Applied. Best regards, Krzysztof
diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c index 9339a7c75fdd..414bfb481266 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; }
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> --- Not tested on HW. --- drivers/memory/omap-gpmc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)