gve: Fix bug in gve_rx_alloc/free_ring

In gve_rx_free_ring, now that we are setting the pagecount high, rather
than just freeing the page with put_page we need to make sure we
subtract off the bias first.

In gve_rx_alloc_ring, we need to unfill the ring if the allocation fails
to properly cleanup.

In gve_prefill_buffers, if a page allocation failed we weren't cleaning
up properly. In addition to freeing the page we need to reduce the page
count so we should be using free_buffer. We should also be actually
iterating over the buffers that were successfully alloced not using the
local page and addr vars.


Signed-off-by: Catherine Sullivan <csully@google.com>
Change-Id: Ic944a6f59ad522fb7fdd96a5e28d492bf855561a
Reviewed-on: https://cos-review.googlesource.com/c/third_party/kernel/+/14552
Reviewed-by: Oleksandr Tymoshenko <ovt@google.com>
Tested-by: Vaibhav Rustagi <vaibhavrustagi@google.com>
1 file changed