mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
x86/microcode: Add missing unlock in microcode_update_helper()
microcode_update_helper() may return early while holding
cpu_add_remove_lock, hence preventing any writers from taking it again.
Leave through the `put` label instead so it's properly released.
Fixes: 5ed12565aa ("microcode: rendezvous CPUs in NMI handler and load ucode")
Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
1 parent
a5917ca28b
commit
b35b22acb8
1 file changed
+2
-1
@@ -599,7 +599,8 @@ static long cf_check microcode_update_helper(void *data)
|
||||
printk(XENLOG_WARNING
|
||||
"CPU%u is expected to lead ucode loading (but got CPU%u)\n",
|
||||
nmi_cpu, cpumask_first(&cpu_online_map));
|
||||
return -EPERM;
|
||||
ret = -EPERM;
|
||||
goto put;
|
||||
}
|
||||
|
||||
patch = parse_blob(buffer->buffer, buffer->len);
|
||||
|
||||