Skip to content

Commit

Permalink
rrunner.c: fix possible memory leak in rr_init_one()
Browse files Browse the repository at this point in the history
In the event that register_netdev() failed, the rrpriv->evt_ring
allocation would have not been freed.

Signed-off-by: David Oostdyk <daveo@ll.mit.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David Oostdyk authored and David S. Miller committed Mar 10, 2013
1 parent 29cd8ae commit fef4c86
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/hippi/rrunner.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ static int rr_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
return 0;

out:
if (rrpriv->evt_ring)
pci_free_consistent(pdev, EVT_RING_SIZE, rrpriv->evt_ring,
rrpriv->evt_ring_dma);
if (rrpriv->rx_ring)
pci_free_consistent(pdev, RX_TOTAL_SIZE, rrpriv->rx_ring,
rrpriv->rx_ring_dma);
Expand Down

0 comments on commit fef4c86

Please sign in to comment.