[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH] stream: fix crash in stream_start() when block_job_
From: |
Alberto Garcia |
Subject: |
[Qemu-block] [PATCH] stream: fix crash in stream_start() when block_job_create() fails |
Date: |
Mon, 15 May 2017 12:34:24 +0300 |
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().
Signed-off-by: Alberto Garcia <address@hidden>
---
block/stream.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/stream.c b/block/stream.c
index 0113710845..52d329f5c6 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);
}
}
--
2.11.0
- [Qemu-block] [PATCH] stream: fix crash in stream_start() when block_job_create() fails,
Alberto Garcia <=