Skip to content

Commit f9336e3

Browse files
Sean Christophersonbonzini
authored andcommitted
KVM: nVMX: Replace a BUG_ON(1) with BUG() to squash clang warning
Use BUG() in the impossible-to-hit default case when switching on the scope of INVEPT to squash a warning with clang 11 due to clang treating the BUG_ON() as conditional. >> arch/x86/kvm/vmx/nested.c:5246:3: warning: variable 'roots_to_free' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] BUG_ON(1); Reported-by: kbuild test robot <[email protected]> Fixes: ce8fe7b ("KVM: nVMX: Free only the affected contexts when emulating INVEPT") Signed-off-by: Sean Christopherson <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 00a6a5e commit f9336e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kvm/vmx/nested.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5165,7 +5165,7 @@ static int handle_invept(struct kvm_vcpu *vcpu)
51655165
*/
51665166
break;
51675167
default:
5168-
BUG_ON(1);
5168+
BUG();
51695169
break;
51705170
}
51715171

0 commit comments

Comments
 (0)