Files
linux/drivers/vhost
Stefano Garzarella 7d75f8038b UPSTREAM: vringh: don't use vringh_kiov_advance() in vringh_iov_xfer()
commit 7aed44babc upstream.

In the while loop of vringh_iov_xfer(), `partlen` could be 0 if one of
the `iov` has 0 lenght.
In this case, we should skip the iov and go to the next one.
But calling vringh_kiov_advance() with 0 lenght does not cause the
advancement, since it returns immediately if asked to advance by 0 bytes.

Let's restore the code that was there before commit b8c06ad4d6
("vringh: implement vringh_kiov_advance()"), avoiding using
vringh_kiov_advance().

Bug: 302200656
Fixes: b8c06ad4d6 ("vringh: implement vringh_kiov_advance()")
Cc: stable@vger.kernel.org
Reported-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 3a72decd6b)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I5ed14650aca07e0f8d52023cf148bd63e87d04c9
2023-10-31 16:50:05 +00:00
..
2020-04-02 10:41:40 -04:00
2021-09-05 16:23:08 -04:00
2020-06-22 12:34:21 -04:00
2020-06-22 12:34:21 -04:00
2023-01-18 13:13:15 +00:00