Skip to content

Commit 063a932

Browse files
Zhang ChangzhongPaolo Abeni
authored andcommitted
ethernet: aeroflex: fix potential skb leak in greth_init_rings()
The greth_init_rings() function won't free the newly allocated skb when dma_mapping_error() returns error, so add dev_kfree_skb() to fix it. Compile tested only. Fixes: d4c4113 ("net: Add Aeroflex Gaisler 10/100/1G Ethernet MAC driver") Signed-off-by: Zhang Changzhong <[email protected]> Reviewed-by: Leon Romanovsky <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent 8895617 commit 063a932

File tree

1 file changed

+1
-0
lines changed
  • drivers/net/ethernet/aeroflex

1 file changed

+1
-0
lines changed

drivers/net/ethernet/aeroflex/greth.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ static int greth_init_rings(struct greth_private *greth)
258258
if (dma_mapping_error(greth->dev, dma_addr)) {
259259
if (netif_msg_ifup(greth))
260260
dev_err(greth->dev, "Could not create initial DMA mapping\n");
261+
dev_kfree_skb(skb);
261262
goto cleanup;
262263
}
263264
greth->rx_skbuff[i] = skb;

0 commit comments

Comments
 (0)