Commit 525989a5 authored by Alberto Garcia's avatar Alberto Garcia Committed by Kevin Wolf
Browse files

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 a170a91f,
likely because the code was copied from stream_complete().

Cc: qemu-stable@nongnu.org
Reported-by: default avatarKashyap Chamarthy <kchamart@redhat.com>
Signed-off-by: default avatarAlberto Garcia <berto@igalia.com>
Tested-by: default avatarKashyap Chamarthy <kchamart@redhat.com>
Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
parent 9964e96d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
    }
}