Commit fef4c86e authored by David Oostdyk's avatar David Oostdyk Committed by David S. Miller

rrunner.c: fix possible memory leak in rr_init_one()

In the event that register_netdev() failed, the rrpriv->evt_ring
allocation would have not been freed.
Signed-off-by: default avatarDavid Oostdyk <daveo@ll.mit.edu>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 29cd8ae0
...@@ -202,6 +202,9 @@ static int rr_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -202,6 +202,9 @@ static int rr_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
return 0; return 0;
out: out:
if (rrpriv->evt_ring)
pci_free_consistent(pdev, EVT_RING_SIZE, rrpriv->evt_ring,
rrpriv->evt_ring_dma);
if (rrpriv->rx_ring) if (rrpriv->rx_ring)
pci_free_consistent(pdev, RX_TOTAL_SIZE, rrpriv->rx_ring, pci_free_consistent(pdev, RX_TOTAL_SIZE, rrpriv->rx_ring,
rrpriv->rx_ring_dma); rrpriv->rx_ring_dma);
......
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