mirror of
https://github.com/torvalds/linux.git
synced 2026-11-24 15:33:28 +00:00
x86, microcode: Correct sysdev_add error path
When we encounter an error while initting the microcode driver on a CPU, we must undo the previously added sysfs group. Cc: Tigran Aivazian <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Acked-by: Andreas Herrmann <[email protected]>
This commit is contained in:
@@ -417,8 +417,10 @@ static int mc_sysdev_add(struct sys_device *sys_dev)
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
if (microcode_init_cpu(cpu) == UCODE_ERROR)
|
||||
err = -EINVAL;
|
||||
if (microcode_init_cpu(cpu) == UCODE_ERROR) {
|
||||
sysfs_remove_group(&sys_dev->kobj, &mc_attr_group);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user