Commit 64c426df authored by Yang Yingliang's avatar Yang Yingliang Committed by David S. Miller

gve: Fix error return code in gve_prefill_rx_pages()

If alloc_page() fails in gve_prefill_rx_pages(), it should return
an error code in the error path.

Fixes: 82fd151d ("gve: Reduce alloc and copy costs in the GQ rx path")
Cc: Jeroen de Borst <jeroendb@google.com>
Cc: Catherine Sullivan <csully@google.com>
Cc: Shailend Chand <shailend@google.com>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6c8fae0c
...@@ -150,8 +150,10 @@ static int gve_prefill_rx_pages(struct gve_rx_ring *rx) ...@@ -150,8 +150,10 @@ static int gve_prefill_rx_pages(struct gve_rx_ring *rx)
for (j = 0; j < rx->qpl_copy_pool_mask + 1; j++) { for (j = 0; j < rx->qpl_copy_pool_mask + 1; j++) {
struct page *page = alloc_page(GFP_KERNEL); struct page *page = alloc_page(GFP_KERNEL);
if (!page) if (!page) {
err = -ENOMEM;
goto alloc_err_qpl; goto alloc_err_qpl;
}
rx->qpl_copy_pool[j].page = page; rx->qpl_copy_pool[j].page = page;
rx->qpl_copy_pool[j].page_offset = 0; rx->qpl_copy_pool[j].page_offset = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment