EDAC: Fix kernel panic on module unloading
EDAC: Fix kernel panic on module unloading

This patch fixes use-after-free and double-free bugs in
edac_mc_sysfs_exit(). mci_pdev has single reference and put_device()
calls mc_attr_release() which calls kfree(). The following
device_del() works with already released memory. An another kfree() in
edac_mc_sysfs_exit() releses the same memory again. Great.

Signed-off-by: Konstantin Khlebnikov <3b96b99f19643d33e1bfa1caa535c041c3608549@openvz.org>
Cc: 4fbacc2fa0ffdbb11bf1ad6925b886ebd08dd15f@vger.kernel.org # 3.[67]
Cc: Denis Kirjanov <8d781aaa4b29bb2b43707891765d1a0d6e6ff4d4@gmail.com>
Cc: Mauro Carvalho Chehab <ad86ba2154032c9f55743a190faa2459a9d61d42@redhat.com>
Link: aafa600b5401c1e27a89a7326b5cca0532816c97@zurg
Signed-off-by: Borislav Petkov <0691a664b24b6f15b20cd5aee64b72271db08be1@alien8.de>

TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas