Message ID | 20221104061736.1621866-1-yangyingliang@huawei.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 64c426dfbbd2710e4bcac42aaced21fe10f05fde |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net-next] gve: Fix error return code in gve_prefill_rx_pages() | expand |
Hello: This patch was applied to netdev/net-next.git (master) by David S. Miller <davem@davemloft.net>: On Fri, 4 Nov 2022 14:17:36 +0800 you wrote: > If alloc_page() fails in gve_prefill_rx_pages(), it should return > an error code in the error path. > > Fixes: 82fd151d38d9 ("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: Yang Yingliang <yangyingliang@huawei.com> > > [...] Here is the summary with links: - [net-next] gve: Fix error return code in gve_prefill_rx_pages() https://git.kernel.org/netdev/net-next/c/64c426dfbbd2 You are awesome, thank you!
diff --git a/drivers/net/ethernet/google/gve/gve_rx.c b/drivers/net/ethernet/google/gve/gve_rx.c index e2f4494c65fb..1f55137722b0 100644 --- a/drivers/net/ethernet/google/gve/gve_rx.c +++ b/drivers/net/ethernet/google/gve/gve_rx.c @@ -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++) { struct page *page = alloc_page(GFP_KERNEL); - if (!page) + if (!page) { + err = -ENOMEM; goto alloc_err_qpl; + } rx->qpl_copy_pool[j].page = page; rx->qpl_copy_pool[j].page_offset = 0;
If alloc_page() fails in gve_prefill_rx_pages(), it should return an error code in the error path. Fixes: 82fd151d38d9 ("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: Yang Yingliang <yangyingliang@huawei.com> --- drivers/net/ethernet/google/gve/gve_rx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)