Skip to content

Commit

Permalink
block/block-copy: Fix uninitialized variable in block_copy_task_entry
Browse files Browse the repository at this point in the history
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: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200507121129.29760-2-philmd@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
  • Loading branch information
philmd authored and kevmw committed May 18, 2020
1 parent e5d8a40 commit c78dd00
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion block/block-copy.c
Expand Up @@ -418,7 +418,7 @@ static int coroutine_fn block_copy_do_copy(BlockCopyState *s,
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,
Expand Down

0 comments on commit c78dd00

Please sign in to comment.