This patch fix final condition check while moving virtqueue
descriptors.
Fixes:
3bb595ecd682 ("vhost/crypto: add request handler")
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
left -= desc->len;
}
- if (unlikely(left < 0)) {
+ if (unlikely(left > 0)) {
VC_LOG_ERR("Incorrect virtio descriptor");
return -1;
}
left -= to_copy;
}
- if (unlikely(left < 0)) {
+ if (unlikely(left > 0)) {
VC_LOG_ERR("Incorrect virtio descriptor");
return -1;
}