summaryrefslogtreecommitdiffstats
path: root/hw/block
diff options
context:
space:
mode:
authorGonglei2015-06-24 11:29:24 +0200
committerStefan Hajnoczi2015-06-24 17:16:04 +0200
commit12048545019cd1d64c8147ea9277648e685fa489 (patch)
tree50e33fdbb3cdec1e55a0f094a580500ad0e24e1b /hw/block
parentqemu-iotests: fix 051.out after qdev error message change (diff)
downloadqemu-12048545019cd1d64c8147ea9277648e685fa489.tar.gz
qemu-12048545019cd1d64c8147ea9277648e685fa489.tar.xz
qemu-12048545019cd1d64c8147ea9277648e685fa489.zip
virito-blk: drop duplicate check
in_num = req->elem.in_num, and req->elem.in_num is checked in line 489, so the check about in_num variable is superflous, let's drop it. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Fam Zheng <famz@redhat.com> Message-id: 1435138164-11728-1-git-send-email-arei.gonglei@huawei.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'hw/block')
-rw-r--r--hw/block/virtio-blk.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index bbb1fc1877..6aefda4bf2 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -499,8 +499,7 @@ void virtio_blk_handle_request(VirtIOBlockReq *req, MultiReqBuffer *mrb)
iov_discard_front(&iov, &out_num, sizeof(req->out));
- if (in_num < 1 ||
- in_iov[in_num - 1].iov_len < sizeof(struct virtio_blk_inhdr)) {
+ if (in_iov[in_num - 1].iov_len < sizeof(struct virtio_blk_inhdr)) {
error_report("virtio-blk request inhdr too short");
exit(1);
}