diff options
author | Pan Nengyuan <pannengyuan@huawei.com> | 2020-01-08 10:51:32 +0800 |
---|---|---|
committer | Laurent Vivier <laurent@vivier.eu> | 2020-01-08 16:08:17 +0100 |
commit | bdf200a55357296dab095348a86f758f749aeef1 (patch) | |
tree | f9668c3d70946009767f379db1b2b1545814306c /nbd/server.c | |
parent | 638be47830ec77faf02dad650e4b9d266997067d (diff) | |
download | qemu-bdf200a55357296dab095348a86f758f749aeef1.zip qemu-bdf200a55357296dab095348a86f758f749aeef1.tar.gz qemu-bdf200a55357296dab095348a86f758f749aeef1.tar.bz2 |
nbd: fix uninitialized variable warning
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>
Diffstat (limited to 'nbd/server.c')
-rw-r--r-- | nbd/server.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/nbd/server.c b/nbd/server.c index 24ebc1a..87fcd2e 100644 --- a/nbd/server.c +++ b/nbd/server.c @@ -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; |