2014-01-02 08:24:35

by Yijing Wang

[permalink] [raw]
Subject: [PATCH] x86, hpet: fix memleak when hpet enable fail

We should free hpet_boot_cfg if hpet enable fail.

Signed-off-by: Yijing Wang <[email protected]>
---
arch/x86/kernel/hpet.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index da85a8e..0ed00cc 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -900,6 +900,7 @@ int __init hpet_enable(void)
return 0;

out_nohpet:
+ kfree(hpet_boot_cfg);
hpet_clear_mapping();
hpet_address = 0;
return 0;
--
1.7.1