x86/efi: Fix dummy variable buffer allocation
authorBen Hutchings <ben@decadent.org.uk>
Sun, 16 Jun 2013 20:27:12 +0000 (21:27 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Jun 2014 23:02:10 +0000 (16:02 -0700)
commit354ad5e4dda15aef33da119a93e413161ae99525
tree691135a4402c54991da7c2e24ace21daedc4d31c
parentf4f009b04f6ae98e0a147e9b3d3f4078bbd416ee
x86/efi: Fix dummy variable buffer allocation

commit b8cb62f82103083a6e8fa5470bfe634a2c06514d upstream.

1. Check for allocation failure
2. Clear the buffer contents, as they may actually be written to flash
3. Don't leak the buffer

Compile-tested only.

[ Tested successfully on my buggy ASUS machine - Matt ]

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Cc: Rui Xiang <rui.xiang@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/platform/efi/efi.c