Skip to content
Snippets Groups Projects
Commit c78dd00e authored by Philippe Mathieu-Daudé's avatar Philippe Mathieu-Daudé Committed by Kevin Wolf
Browse files

block/block-copy: Fix uninitialized variable in block_copy_task_entry


Fix when building with -Os:

    CC      block/block-copy.o
  block/block-copy.c: In function ‘block_copy_task_entry’:
  block/block-copy.c:428:38: error: ‘error_is_read’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
    428 |         t->call_state->error_is_read = error_is_read;
        |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~

Signed-off-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200507121129.29760-2-philmd@redhat.com>
Reviewed-by: default avatarEric Blake <eblake@redhat.com>
Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
parent e5d8a406
No related branches found
No related tags found
No related merge requests found
......@@ -418,7 +418,7 @@ out:
static coroutine_fn int block_copy_task_entry(AioTask *task)
{
BlockCopyTask *t = container_of(task, BlockCopyTask, task);
bool error_is_read;
bool error_is_read = false;
int ret;
ret = block_copy_do_copy(t->s, t->offset, t->bytes, t->zeroes,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment