rrunner.c: fix possible memory leak in rr_init_one()
authorDavid Oostdyk <daveo@ll.mit.edu>
Fri, 8 Mar 2013 08:28:15 +0000 (08:28 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 10 Mar 2013 20:42:23 +0000 (16:42 -0400)
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>
drivers/net/hippi/rrunner.c

index e5b19b0..3c4d627 100644 (file)
@@ -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);