Commit bac81f40 authored by Yuan Can's avatar Yuan Can Committed by David S. Miller

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: 2dc95a4d ("net: Add dm9051 driver")
Signed-off-by: default avatarYuan Can <yuancan@huawei.com>
Reviewed-by: default avatarMaciej Fijalkowski <maciej.fijalkowski@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1c40cde6
...@@ -798,8 +798,10 @@ static int dm9051_loop_rx(struct board_info *db) ...@@ -798,8 +798,10 @@ static int dm9051_loop_rx(struct board_info *db)
} }
ret = dm9051_stop_mrcmd(db); ret = dm9051_stop_mrcmd(db);
if (ret) if (ret) {
dev_kfree_skb(skb);
return ret; return ret;
}
skb->protocol = eth_type_trans(skb, db->ndev); skb->protocol = eth_type_trans(skb, db->ndev);
if (db->ndev->features & NETIF_F_RXCSUM) if (db->ndev->features & NETIF_F_RXCSUM)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment