diff --git a/xen/common/kexec.c b/xen/common/kexec.c index 9999babce6..17f3ed793d 100644 --- a/xen/common/kexec.c +++ b/xen/common/kexec.c @@ -785,17 +785,14 @@ static int kexec_swap_images(int type, struct kexec_image *new, *old = NULL; - spin_lock(&kexec_lock); - if ( test_bit(KEXEC_FLAG_IN_PROGRESS, &kexec_flags) ) - { - spin_unlock(&kexec_lock); return -EBUSY; - } if ( kexec_load_get_bits(type, &base, &bit) ) return -EINVAL; + spin_lock(&kexec_lock); + pos = (test_bit(bit, &kexec_flags) != 0); old_slot = base + pos; new_slot = base + !pos;