Skip to content

Commit

Permalink
net: qlogic: Fix memory leak in ql_alloc_large_buffers
Browse files Browse the repository at this point in the history
In ql_alloc_large_buffers, a new skb is allocated via netdev_alloc_skb.
This skb should be released if pci_dma_mapping_error fails.

Fixes: 0f8ab89 ("qla3xxx: Check return code from pci_map_single() in ql_release_to_lrg_buf_free_list(), ql_populate_free_queue(), ql_alloc_large_buffers(), and ql3xxx_send()")
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Navidem authored and davem330 committed Oct 5, 2019
1 parent a0c2dc1 commit 1acb8f2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/ethernet/qlogic/qla3xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2787,6 +2787,7 @@ static int ql_alloc_large_buffers(struct ql3_adapter *qdev)
netdev_err(qdev->ndev,
"PCI mapping failed with error: %d\n",
err);
dev_kfree_skb_irq(skb);
ql_free_large_buffers(qdev);
return -ENOMEM;
}
Expand Down

0 comments on commit 1acb8f2

Please sign in to comment.