Skip to content

Commit e82df67

Browse files
Tiwei Biemstsirkin
authored andcommitted
virtio_ring: fix num_free handling in error case
The vq->vq.num_free hasn't been changed when error happens, so it shouldn't be changed when handling the error. Fixes: 780bc79 ("virtio_ring: Support DMA APIs") Cc: Andy Lutomirski <[email protected]> Cc: Michael S. Tsirkin <[email protected]> Cc: [email protected] Signed-off-by: Tiwei Bie <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent 4a3928c commit e82df67

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

drivers/virtio/virtio_ring.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,8 +428,6 @@ static inline int virtqueue_add(struct virtqueue *_vq,
428428
i = virtio16_to_cpu(_vq->vdev, vq->vring.desc[i].next);
429429
}
430430

431-
vq->vq.num_free += total_sg;
432-
433431
if (indirect)
434432
kfree(desc);
435433

0 commit comments

Comments
 (0)