Message ID | e65152d5483b2c847ec7a947ed52650152cfdcc0.1718638495.git.yong.huang@smartx.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [PULL,1/1] migration/dirtyrate: Fix segmentation fault | expand |
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 009b49de44..854cb86b22 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -2329,7 +2329,7 @@ bool kvm_vcpu_id_is_valid(int vcpu_id) bool kvm_dirty_ring_enabled(void) { - return kvm_state->kvm_dirty_ring_size ? true : false; + return kvm_state && kvm_state->kvm_dirty_ring_size; } static void query_stats_cb(StatsResultList **result, StatsTarget target,