From: Alberto Garcia Date: Mon, 15 May 2017 09:34:24 +0000 (+0300) Subject: stream: fix crash in stream_start() when block_job_create() fails X-Git-Tag: v2.9.1~79 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c60a8ed89bcbccc48f4c9bd1088c0295019dec96;p=thirdparty%2Fqemu.git 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 Signed-off-by: Alberto Garcia Tested-by: Kashyap Chamarthy Signed-off-by: Kevin Wolf (cherry picked from commit 525989a50a70ea0ffa2b1cdf56279765bb2b7de0) Signed-off-by: Michael Roth --- diff --git a/block/stream.c b/block/stream.c index 0113710845e..52d329f5c62 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); } }