From: Borislav Petkov <[email protected]>

Free the array page if a failure is encountered while creating the
debugfs nodes.

Signed-off-by: Borislav Petkov <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: linux-edac <[email protected]>
---
 drivers/ras/cec.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/ras/cec.c b/drivers/ras/cec.c
index 667a126f39f1..8a04b9864192 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);
-- 
2.21.0

Reply via email to