]> git.proxmox.com Git - mirror_qemu.git/blobdiff - block/snapshot.c
usb: check device is not NULL before calling usb_ep_get()
[mirror_qemu.git] / block / snapshot.c
index f9903bc94e15b17a6d099b290b8546271a94bda2..3218a542df833170b4da85f91c726131651d6894 100644 (file)
@@ -218,7 +218,9 @@ int bdrv_snapshot_goto(BlockDriverState *bs,
         qobject_unref(file_options);
         qdict_put_str(options, "file", bdrv_get_node_name(file));
 
-        drv->bdrv_close(bs);
+        if (drv->bdrv_close) {
+            drv->bdrv_close(bs);
+        }
         bdrv_unref_child(bs, bs->file);
         bs->file = NULL;