Skip to content
Commit d21b3c60 authored by Colin Ian King's avatar Colin Ian King Committed by Sean Christopherson
Browse files

KVM: selftests: Fix shift of 32 bit unsigned int more than 32 bits

Currrentl a 32 bit 1u value is being shifted more than 32 bits causing
overflow and incorrect checking of bits 32-63. Fix this by using the
BIT_ULL macro for shifting bits.

Detected by cppcheck:
sev_init2_tests.c:108:34: error: Shifting 32-bit value by 63 bits is
undefined behaviour [shiftTooManyBits]

Fixes: dfc083a1

 ("selftests: kvm: add tests for KVM_SEV_INIT2")
Signed-off-by: default avatarColin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/r/20240523154102.2236133-1-colin.i.king@gmail.com
Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
parent c3f38fa6
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment