net: broadcom: bcm4908_enet: fix RX path possible mem leak
Subsystems (3)
PATCH 1/1 net: broadcom: bcm4908_enet: fix RX path possible mem leak
From: Rafał Miłecki <[email protected]>
After filling RX ring slot with new skb it's required to free old skb. Immediately on error or later in the net subsystem.
--- drivers/net/ethernet/broadcom/bcm4908_enet.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/broadcom/bcm4908_enet.c +1 -0
@@ -570,6 +570,7 @@ static int bcm4908_enet_poll(struct napi_struct *napi, int weight)if (len <ETH_ZLEN || (ctl & (DMA_CTL_STATUS_SOP |DMA_CTL_STATUS_EOP )) != (DMA_CTL_STATUS_SOP |DMA_CTL_STATUS_EOP )) { +kfree_skb (slot.skb); enet->netdev->stats.rx_dropped++;break ; }
Signature · 1 line
2.26.2
PATCH 1/1 net: broadcom: bcm4908_enet: fix NAPI poll returned value
From: Rafał Miłecki <[email protected]>
Missing increment was resulting in poll function always returning 0 instead of amount of processed packets.
--- drivers/net/ethernet/broadcom/bcm4908_enet.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/broadcom/bcm4908_enet.c +2 -0
@@ -583,6 +583,8 @@ static int bcm4908_enet_poll(struct napi_struct *napi, int weight) enet->netdev->stats.rx_packets++; enet->netdev->stats.rx_bytes += len; + + handled++; }if (handled < weight) {
Signature · 1 line
2.26.2
Re: [PATCH net] net: broadcom: bcm4908_enet: fix NAPI poll returned value
Quoted 6 lines · Rafał Miłecki
From: Rafał Miłecki <[email protected]>
Missing increment was resulting in poll function always returning 0 instead of amount of processed packets.
Signed-off-by Rafał Miłecki <[email protected]>
driver")
Signature · 1 line
Florian
Re: [PATCH net] net: broadcom: bcm4908_enet: fix NAPI poll returned value
Quoted 11 lines · On Wed, 24 Feb 2021 09:06:18 -0800 Florian Fainelli wrote:
Quoted 6 lines · Rafał Miłecki
From: Rafał Miłecki <[email protected]>
Missing increment was resulting in poll function always returning 0 instead of amount of processed packets.
Signed-off-by Rafał Miłecki <[email protected]>Acked-by Florian Fainelli <[email protected]>Fixes 4feffeadbcb2 ("net: broadcom: bcm4908enet: add BCM4908 controllerdriver")
Applied, thank you!
Quoted 6 lines · Rafał Miłecki
From: Rafał Miłecki <[email protected]>
After filling RX ring slot with new skb it's required to free old skb. Immediately on error or later in the net subsystem.
Signed-off-by Rafał Miłecki <[email protected]>
driver")
Signature · 1 line
Florian