diff options
author | Eric Blake <eblake@redhat.com> | 2022-05-16 16:05:19 -0500 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2022-06-24 17:07:06 +0200 |
commit | 2866ddd121f5ccaabf1752a8d25eab9be1309d3f (patch) | |
tree | d27cff7de2478e8e73f9ebf2e69c01837ea7d7b5 /block | |
parent | 7455ff1aa01564cc175db5b2373e610503ad4411 (diff) | |
download | qemu-2866ddd121f5ccaabf1752a8d25eab9be1309d3f.zip qemu-2866ddd121f5ccaabf1752a8d25eab9be1309d3f.tar.gz qemu-2866ddd121f5ccaabf1752a8d25eab9be1309d3f.tar.bz2 |
nbd: Drop dead code spotted by Coverity
CID 1488362 points out that the second 'rc >= 0' check is now dead
code.
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Fixes: 172f5f1a40(nbd: remove peppering of nbd_client_connected)
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20220516210519.76135-1-eblake@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Vladimir Sementsov-Ogievskiy <v.sementsov-og@mail.ru>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/nbd.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/block/nbd.c b/block/nbd.c index 6085ab1..7f5f50e 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -521,12 +521,8 @@ static int coroutine_fn nbd_co_send_request(BlockDriverState *bs, if (qiov) { qio_channel_set_cork(s->ioc, true); rc = nbd_send_request(s->ioc, request); - if (rc >= 0) { - if (qio_channel_writev_all(s->ioc, qiov->iov, qiov->niov, - NULL) < 0) { - rc = -EIO; - } - } else if (rc >= 0) { + if (rc >= 0 && qio_channel_writev_all(s->ioc, qiov->iov, qiov->niov, + NULL) < 0) { rc = -EIO; } qio_channel_set_cork(s->ioc, false); |