qemu-e2k/block
Vladimir Sementsov-Ogievskiy 0df62f45c1 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: 7df7868b96
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>
2020-02-06 13:47:45 +01:00
..
accounting.c
aio_task.c
backup-top.c block/backup-top: fix failure path 2020-02-06 13:47:45 +01:00
backup-top.h
backup.c
blkdebug.c
blklogwrites.c
blkreplay.c
blkverify.c
block-backend.c
block-copy.c
bochs.c
cloop.c
commit.c
copy-on-read.c
create.c
crypto.c
crypto.h
curl.c
dirty-bitmap.c
dmg-bz2.c
dmg-lzfse.c
dmg.c
dmg.h
file-posix.c
file-win32.c
filter-compress.c
gluster.c
io_uring.c
io.c
iscsi-opts.c
iscsi.c
linux-aio.c
Makefile.objs
mirror.c
nbd.c
nfs.c
null.c
nvme.c
parallels.c
parallels.h
qapi.c
qcow2-bitmap.c
qcow2-cache.c
qcow2-cluster.c
qcow2-refcount.c
qcow2-snapshot.c
qcow2-threads.c
qcow2.c
qcow2.h
qcow.c
qed-check.c
qed-cluster.c
qed-l2-cache.c
qed-table.c
qed.c
qed.h
quorum.c
raw-format.c
rbd.c
replication.c
sheepdog.c
snapshot.c
ssh.c
stream.c
throttle-groups.c
throttle.c
trace-events
vdi.c
vhdx-endian.c
vhdx-log.c
vhdx.c
vhdx.h
vmdk.c
vpc.c
vvfat.c
vxhs.c
win32-aio.c
write-threshold.c