net: mvneta: fix possible memory leak in mvneta_swbm_add_rx_fragment
authorLorenzo Bianconi <lorenzo@kernel.org>
Fri, 13 Nov 2020 18:16:57 +0000 (19:16 +0100)
committerJakub Kicinski <kuba@kernel.org>
Tue, 17 Nov 2020 00:30:50 +0000 (16:30 -0800)
commit9c79a8ab5f124db01eb1d7287454a702f0d4252f
treebb60e96ba63669a19278e03632817a25a02e8b3d
parent8e5debed39017836a850c6c7bfacc93299d19bad
net: mvneta: fix possible memory leak in mvneta_swbm_add_rx_fragment

Recycle the page running page_pool_put_full_page() in
mvneta_swbm_add_rx_fragment routine when the last descriptor
contains just the FCS or if the received packet contains more than
MAX_SKB_FRAGS fragments

Fixes: ca0e014609f0 ("net: mvneta: move skb build after descriptors processing")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/df6a2bad70323ee58d3901491ada31c1ca2a40b9.1605291228.git.lorenzo@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/marvell/mvneta.c