|
|
@@ -2073,7 +2073,7 @@ static int get_indirect(struct vhost_virtqueue *vq,
|
|
|
/* If this is an input descriptor, increment that count. */
|
|
|
if (access == VHOST_ACCESS_WO) {
|
|
|
*in_num += ret;
|
|
|
- if (unlikely(log)) {
|
|
|
+ if (unlikely(log && ret)) {
|
|
|
log[*log_num].addr = vhost64_to_cpu(vq, desc.addr);
|
|
|
log[*log_num].len = vhost32_to_cpu(vq, desc.len);
|
|
|
++*log_num;
|
|
|
@@ -2216,7 +2216,7 @@ int vhost_get_vq_desc(struct vhost_virtqueue *vq,
|
|
|
/* If this is an input descriptor,
|
|
|
* increment that count. */
|
|
|
*in_num += ret;
|
|
|
- if (unlikely(log)) {
|
|
|
+ if (unlikely(log && ret)) {
|
|
|
log[*log_num].addr = vhost64_to_cpu(vq, desc.addr);
|
|
|
log[*log_num].len = vhost32_to_cpu(vq, desc.len);
|
|
|
++*log_num;
|