diff options
author | Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> | 2020-01-21 17:28:01 +0300 |
---|---|---|
committer | Michael Roth <mdroth@linux.vnet.ibm.com> | 2020-06-22 12:49:28 -0500 |
commit | e92b21ffc402b0feec5703a718affd9453a2a196 (patch) | |
tree | 7aae0ccd32e908bfb6ca7f1d71ead9b2b9783774 /target | |
parent | a967e75f3a65ccfca3e793e4cb8223449f20a9c5 (diff) | |
download | qemu-e92b21ffc402b0feec5703a718affd9453a2a196.zip qemu-e92b21ffc402b0feec5703a718affd9453a2a196.tar.gz qemu-e92b21ffc402b0feec5703a718affd9453a2a196.tar.bz2 |
block/backup-top: fix failure path
We can't access top after call bdrv_backup_top_drop, as it is already
freed at this time.
Also, no needs to unref target child by hand, it will be unrefed on
bdrv_close() automatically.
So, just do bdrv_backup_top_drop if append succeed and one bdrv_unref
otherwise.
Note, that in !appended case bdrv_unref(top) moved into drained section
on source. It doesn't really matter, but just for code simplicity.
Fixes: 7df7868b96404
Cc: qemu-stable@nongnu.org # v4.2.0
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 20200121142802.21467-2-vsementsov@virtuozzo.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
(cherry picked from commit 0df62f45c1de6c020f1e6fba4eeafd248209b003)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Diffstat (limited to 'target')
0 files changed, 0 insertions, 0 deletions