diff mbox series

[net-next] gve: Fix error return code in gve_prefill_rx_pages()

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

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 3 maintainers not CCed: pabeni@redhat.com edumazet@google.com kuba@kernel.org
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 11 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Yang Yingliang Nov. 4, 2022, 6:17 a.m. UTC
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(-)

Comments

patchwork-bot+netdevbpf@kernel.org Nov. 7, 2022, 11:40 a.m. UTC | #1
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 mbox series

Patch

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;