All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Oostdyk <daveo@ll.mit.edu>
To: <netdev@vger.kernel.org>
Cc: <jes@trained-monkey.org>, <daveo@ll.mit.edu>
Subject: [PATCH] rrunner.c: fix possible memory leak in rr_init_one()
Date: Fri, 8 Mar 2013 12:23:22 -0500	[thread overview]
Message-ID: <513A1E8A.7040408@ll.mit.edu> (raw)

[-- Attachment #1: Type: text/plain, Size: 770 bytes --]

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>
---
  drivers/net/hippi/rrunner.c | 3 +++
  1 file changed, 3 insertions(+)

diff --git a/drivers/net/hippi/rrunner.c b/drivers/net/hippi/rrunner.c
index d471963..970595a 100644
--- a/drivers/net/hippi/rrunner.c
+++ b/drivers/net/hippi/rrunner.c
@@ -203,6 +203,9 @@ static int __devinit rr_init_one(struct pci_dev *pdev,
  	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);
-- 
1.8.1.5



[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4567 bytes --]

             reply	other threads:[~2013-03-08 17:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-08 17:23 David Oostdyk [this message]
2013-03-08 17:32 ` [PATCH] rrunner.c: fix possible memory leak in rr_init_one() David Miller
  -- strict thread matches above, loose matches on Subject: below --
2013-03-08 18:28 daveo
2013-03-10 20:43 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=513A1E8A.7040408@ll.mit.edu \
    --to=daveo@ll.mit.edu \
    --cc=jes@trained-monkey.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.