On Wed, 06/24 17:29, [email protected] wrote: > From: Gonglei <[email protected]> > > 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 <[email protected]>
Reviewed-by: Fam Zheng <[email protected]> > --- > hw/block/virtio-blk.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c > index cd539aa..cce552a 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); > } > -- > 1.7.12.4 > > >
