From 1c85ea5df86bed136589a2866c22f394020d3fdf Mon Sep 17 00:00:00 2001 From: Daniel Zahka Date: Tue, 22 Sep 2026 12:53:28 -0700 Subject: [PATCH] eth: fbnic: put back netmem reference when xdp_buff_add_frag() fails fbnic_add_rx_frag() takes a page_pool reference out of the buffer's pagecnt_bias before handing the fragment to xdp_buff_add_frag(). If that call fails it has not taken ownership of the netmem: the fragment is not recorded in the shared info, and fbnic_put_pkt_buff() will not put the reference back. Put the netmem reference back on the failure path. Signed-off-by: Daniel Zahka Link: https://patch.msgid.link/20260922-fbnic-refcount-fix-v1-1-31e5862c9893@gmail.com Signed-off-by: Paolo Abeni --- drivers/net/ethernet/meta/fbnic/fbnic_txrx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c index 447ec5522499..bbc3c9e89a38 100644 --- a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c +++ b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c @@ -1045,6 +1045,7 @@ static void fbnic_add_rx_frag(struct fbnic_napi_vector *nv, u64 rcd, pkt->add_frag_failed = true; netdev_err_once(nv->napi.dev, "Failed to add fragment to xdp_buff\n"); + page_pool_put_full_netmem(qt->sub1.page_pool, netmem, true); } }