x86/microcode/intel: Fix memleak in save_microcode_patch()
authorZhenzhong Duan <zhenzhong.duan@oracle.com>
Fri, 22 Jun 2018 11:51:26 +0000 (13:51 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Aug 2018 11:09:04 +0000 (13:09 +0200)
commitb580cead624b5e0471cd418b3c0a6f20d15e95ba
treeebb65d21a483bdf614c11cb4256c30a7f4f54626
parent99654c9ffcea2d835283aa8c570432bd03ca6943
x86/microcode/intel: Fix memleak in save_microcode_patch()

[ Upstream commit 0218c766263e70795c5eaa17d75ed54bca350950 ]

Free useless ucode_patch entry when it's replaced.

[ bp: Drop the memfree_patch() two-liner. ]

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Srinivas REDDY Eeda <srinivas.eeda@oracle.com>
Link: http://lkml.kernel.org/r/888102f0-fd22-459d-b090-a1bd8a00cb2b@default
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kernel/cpu/microcode/intel.c