kexec: ensure kexec_status() return bit value of 0 or 1

When checking kexec_flags bit corresponding to the
requested image, ensure that 0 or 1 is returned.

Signed-off-by: Eric DeVolder <eric.devolder@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
Eric DeVolder authored and Andrew Cooper committed 2017-01-20 13:41:28 +00:00
1 parent 366ff5f1b3
commit f07618c290
1 file changed
+1 -1
+1 -1
View File
@@ -1182,7 +1182,7 @@ static int kexec_status(XEN_GUEST_HANDLE_PARAM(void) uarg)
if ( kexec_load_get_bits(status.type, &base, &bit) )
return -EINVAL;
return test_bit(bit, &kexec_flags);
return !!test_bit(bit, &kexec_flags);
}
static int do_kexec_op_internal(unsigned long op,
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.