From: David Oostdyk Date: Fri, 8 Mar 2013 08:28:15 +0000 (+0000) Subject: rrunner.c: fix possible memory leak in rr_init_one() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fef4c86e59a76f2ec1a77d5732f40752700bd5dd;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 Signed-off-by: David S. Miller --- diff --git a/drivers/net/hippi/rrunner.c b/drivers/net/hippi/rrunner.c index e5b19b056909..3c4d6274bb9b 100644 --- a/drivers/net/hippi/rrunner.c +++ b/drivers/net/hippi/rrunner.c @@ -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);