Skip to content
Commit adad0d02 authored by Colin Ian King's avatar Colin Ian King Committed by Paolo Bonzini
Browse files

kvm: svm: fix unsigned compare less than zero comparison



vm_data->avic_vm_id is a u32, so the check for a error
return (less than zero) such as -EAGAIN from
avic_get_next_vm_id currently has no effect whatsoever.
Fix this by using a temporary int for the comparison
and assign vm_data->avic_vm_id to this. I used an explicit
u32 cast in the assignment to show why vm_data->avic_vm_id
cannot be used in the assign/compare steps.

Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Acked-by: default avatarJoerg Roedel <jroedel@suse.de>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 095cf55d
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