Skip to content

Commit fef4c86

Browse files
David Oostdykdavem330
authored andcommitted
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: David Oostdyk <daveo@ll.mit.edu> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 29cd8ae commit fef4c86

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎drivers/net/hippi/rrunner.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,9 @@ static int rr_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
202202
return 0;
203203

204204
out:
205+
if (rrpriv->evt_ring)
206+
pci_free_consistent(pdev, EVT_RING_SIZE, rrpriv->evt_ring,
207+
rrpriv->evt_ring_dma);
205208
if (rrpriv->rx_ring)
206209
pci_free_consistent(pdev, RX_TOTAL_SIZE, rrpriv->rx_ring,
207210
rrpriv->rx_ring_dma);

0 commit comments

Comments
 (0)