Skip to content

Commit

Permalink
nbd: fix uninitialized variable warning
Browse files Browse the repository at this point in the history
Fixes:
/mnt/sdb/qemu/nbd/server.c: In function 'nbd_handle_request':
/mnt/sdb/qemu/nbd/server.c:2313:9: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     int ret;

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Pan Nengyuan <pannengyuan@huawei.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20200108025132.46956-1-pannengyuan@huawei.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
  • Loading branch information
panny060 authored and vivier committed Jan 8, 2020
1 parent 638be47 commit bdf200a
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions nbd/server.c
Expand Up @@ -2384,20 +2384,12 @@ static coroutine_fn int nbd_handle_request(NBDClient *client,
!client->export_meta.bitmap,
NBD_META_ID_BASE_ALLOCATION,
errp);
if (ret < 0) {
return ret;
}
}

if (client->export_meta.bitmap) {
} else { /* client->export_meta.bitmap */
ret = nbd_co_send_bitmap(client, request->handle,
client->exp->export_bitmap,
request->from, request->len,
dont_fragment,
true, NBD_META_ID_DIRTY_BITMAP, errp);
if (ret < 0) {
return ret;
}
}

return ret;
Expand Down

0 comments on commit bdf200a

Please sign in to comment.