aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorAlberto Garcia <berto@igalia.com>2017-05-15 12:34:24 +0300
committerMichael Roth <mdroth@linux.vnet.ibm.com>2017-08-03 14:33:26 -0500
commitc60a8ed89bcbccc48f4c9bd1088c0295019dec96 (patch)
treee9d20c53d8e52b6840654b013f420c6ce543830f /block
parentc79bef68c46cfb04d856516dcc5f828842f2907b (diff)
downloadqemu-c60a8ed89bcbccc48f4c9bd1088c0295019dec96.zip
qemu-c60a8ed89bcbccc48f4c9bd1088c0295019dec96.tar.gz
qemu-c60a8ed89bcbccc48f4c9bd1088c0295019dec96.tar.bz2
stream: fix crash in stream_start() when block_job_create() fails
The code that tries to reopen a BlockDriverState in stream_start() when the creation of a new block job fails crashes because it attempts to dereference a pointer that is known to be NULL. This is a regression introduced in a170a91fd3eab6155da39e740381867e, likely because the code was copied from stream_complete(). Cc: qemu-stable@nongnu.org Reported-by: Kashyap Chamarthy <kchamart@redhat.com> Signed-off-by: Alberto Garcia <berto@igalia.com> Tested-by: Kashyap Chamarthy <kchamart@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 525989a50a70ea0ffa2b1cdf56279765bb2b7de0) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Diffstat (limited to 'block')
-rw-r--r--block/stream.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/stream.c b/block/stream.c
index 0113710..52d329f 100644
--- a/block/stream.c
+++ b/block/stream.c
@@ -280,6 +280,6 @@ void stream_start(const char *job_id, BlockDriverState *bs,
fail:
if (orig_bs_flags != bdrv_get_flags(bs)) {
- bdrv_reopen(bs, s->bs_flags, NULL);
+ bdrv_reopen(bs, orig_bs_flags, NULL);
}
}