Skip to content

Commit 1acb8f2

Browse files
Navidemdavem330
authored andcommitted
net: qlogic: Fix memory leak in ql_alloc_large_buffers
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent a0c2dc1 commit 1acb8f2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/net/ethernet/qlogic/qla3xxx.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2787,6 +2787,7 @@ static int ql_alloc_large_buffers(struct ql3_adapter *qdev)
27872787
netdev_err(qdev->ndev,
27882788
"PCI mapping failed with error: %d\n",
27892789
err);
2790+
dev_kfree_skb_irq(skb);
27902791
ql_free_large_buffers(qdev);
27912792
return -ENOMEM;
27922793
}

0 commit comments

Comments
 (0)