Skip to content

Commit bac81f4

Browse files
Yuan Candavem330
authored andcommitted
net: dm9051: Fix missing dev_kfree_skb() in dm9051_loop_rx()
The dm9051_loop_rx() returns without release skb when dm9051_stop_mrcmd() returns error, free the skb to avoid this leak. Fixes: 2dc95a4 ("net: Add dm9051 driver") Signed-off-by: Yuan Can <[email protected]> Reviewed-by: Maciej Fijalkowski <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 1c40cde commit bac81f4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/net/ethernet/davicom/dm9051.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -798,8 +798,10 @@ static int dm9051_loop_rx(struct board_info *db)
798798
}
799799

800800
ret = dm9051_stop_mrcmd(db);
801-
if (ret)
801+
if (ret) {
802+
dev_kfree_skb(skb);
802803
return ret;
804+
}
803805

804806
skb->protocol = eth_type_trans(skb, db->ndev);
805807
if (db->ndev->features & NETIF_F_RXCSUM)

0 commit comments

Comments
 (0)