--- a/drivers/virtio/virtio_mem.c +++ b/drivers/virtio/virtio_mem.c @@ -577,7 +577,7 @@ static int virtio_mem_sbm_sb_states_prep return -ENOMEM; mutex_lock(&vm->hotplug_mutex); - if (new_bitmap) + if (vm->sbm.sb_states) memcpy(new_bitmap, vm->sbm.sb_states, old_pages * PAGE_SIZE); old_bitmap = vm->sbm.sb_states;