From: Borislav Petkov Date: Sat, 20 Apr 2019 19:39:24 +0000 (+0200) Subject: RAS/CEC: Fix potential memory leak X-Git-Tag: v5.4-rc1~678^2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d0e375e8f26edd2e577e3afa9d952f91037cbd87;p=platform%2Fkernel%2Flinux-rpi.git RAS/CEC: Fix potential memory leak Free the array page if a failure is encountered while creating the debugfs nodes. Signed-off-by: Borislav Petkov Cc: Tony Luck Cc: linux-edac --- diff --git a/drivers/ras/cec.c b/drivers/ras/cec.c index 31868bd..f57e869 100644 --- a/drivers/ras/cec.c +++ b/drivers/ras/cec.c @@ -504,8 +504,10 @@ void __init cec_init(void) return; } - if (create_debugfs_nodes()) + if (create_debugfs_nodes()) { + free_page((unsigned long)ce_arr.array); return; + } INIT_DELAYED_WORK(&cec_work, cec_work_fn); schedule_delayed_work(&cec_work, CEC_DECAY_DEFAULT_INTERVAL);