qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 01/15] stream: fix crash in stream_start() when block


From: Kevin Wolf
Subject: [Qemu-devel] [PULL 01/15] stream: fix crash in stream_start() when block_job_create() fails
Date: Mon, 29 May 2017 17:06:40 +0200

From: Alberto Garcia <address@hidden>

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: address@hidden
Reported-by: Kashyap Chamarthy <address@hidden>
Signed-off-by: Alberto Garcia <address@hidden>
Tested-by: Kashyap Chamarthy <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
 block/stream.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);
     }
 }
-- 
1.8.3.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]