Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

x86/mce/AMD: Make the init code more robust

If mce_device_init() fails then the mce device pointer is NULL and the
AMD mce code happily dereferences it.

Add a sanity check.

Reported-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Reported-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Thomas Gleixner and committed by
Linus Torvalds
0dad3a30 b9d9d691

+3
+3
arch/x86/kernel/cpu/mcheck/mce_amd.c
··· 1182 1182 const char *name = get_name(bank, NULL); 1183 1183 int err = 0; 1184 1184 1185 + if (!dev) 1186 + return -ENODEV; 1187 + 1185 1188 if (is_shared_bank(bank)) { 1186 1189 nb = node_to_amd_nb(amd_get_nb_id(cpu)); 1187 1190