kernel-ark/arch/x86
Jesper Juhl 5cdd2de0a7 x86/microcode: Fix double vfree() and remove redundant pointer checks before vfree()
In arch/x86/kernel/microcode_intel.c::generic_load_microcode()
we have  this:

	while (leftover) {
		...
		if (get_ucode_data(mc, ucode_ptr, mc_size) ||
		    microcode_sanity_check(mc) < 0) {
			vfree(mc);
			break;
		}
		...
	}

	if (mc)
		vfree(mc);

This will cause a double free of 'mc'. This patch fixes that by
just  removing the vfree() call in the loop since 'mc' will be
freed nicely just  after we break out of the loop.

There's also a second change in the patch. I noticed a lot of
checks for  pointers being NULL before passing them to vfree().
That's completely  redundant since vfree() deals gracefully with
being passed a NULL pointer.  Removing the redundant checks
yields a nice size decrease for the object  file.

Size before the patch:
   text    data     bss     dec     hex filename
   4578     240    1032    5850    16da arch/x86/kernel/microcode_intel.o
Size after the patch:
   text    data     bss     dec     hex filename
   4489     240     984    5713    1651 arch/x86/kernel/microcode_intel.o

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Acked-by: Tigran Aivazian <tigran@aivazian.fsnet.co.uk>
Cc: Shaohua Li <shaohua.li@intel.com>
LKML-Reference: <alpine.LNX.2.00.1012251946100.10759@swampdragon.chaosbits.net>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2010-12-27 14:33:30 +01:00
..
boot x86-32: Make sure we can map all of lowmem if we need to 2010-12-16 19:11:09 -08:00
configs
crypto crypto: ghash-intel - ghash-clmulni-intel_glue needs err.h 2010-12-15 19:44:08 +08:00
ia32
include/asm Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6 2010-12-18 10:13:24 -08:00
kernel x86/microcode: Fix double vfree() and remove redundant pointer checks before vfree() 2010-12-27 14:33:30 +01:00
kvm KVM: Fix preemption counter leak in kvm_timer_init() 2010-12-16 12:39:31 +02:00
lguest lguest: populate initial_page_table 2010-12-16 17:03:15 +10:30
lib
math-emu
mm
oprofile
pci x86: avoid low BIOS area when allocating address space 2010-12-17 10:01:17 -08:00
platform
power
tools
vdso x86, gcc-4.6: Use gcc -m options when building vdso 2010-12-13 16:08:37 -08:00
video
xen Merge branches 'x86-fixes-for-linus', 'perf-fixes-for-linus' and 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2010-12-08 06:40:59 -08:00
.gitignore
Kbuild
Kconfig
Kconfig.cpu
Kconfig.debug
Makefile
Makefile_32.cpu