All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sesterhenn <snakebyte@gmx.de>
To: linux-kernel@vger.kernel.org
Cc: andy@andynet.net
Subject: [Patch] Memory leak in drivers/usb/serial/airprime.c
Date: Thu, 05 Oct 2006 12:31:53 +0200	[thread overview]
Message-ID: <1160044314.6153.2.camel@alice> (raw)

hi,

the commit http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=5dda171202f94127e49c12daf780cdae1b4e668b
added a memory leak. In case we cant allocate an urb, we dont free
the buffer and leak it. Coverity id #1438

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>

--- linux-2.6.19-rc1/drivers/usb/serial/airprime.c.orig	2006-10-05 12:25:56.000000000 +0200
+++ linux-2.6.19-rc1/drivers/usb/serial/airprime.c	2006-10-05 12:26:35.000000000 +0200
@@ -133,6 +133,7 @@ static int airprime_open(struct usb_seri
 		}
 		urb = usb_alloc_urb(0, GFP_KERNEL);
 		if (!urb) {
+			kfree(buffer);
 			dev_err(&port->dev, "%s - no more urbs?\n",
 				__FUNCTION__);
 			result = -ENOMEM;



             reply	other threads:[~2006-10-05 10:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-05 10:31 Eric Sesterhenn [this message]
2006-10-06 18:58 ` [Patch] Memory leak in drivers/usb/serial/airprime.c Andy Gay

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=1160044314.6153.2.camel@alice \
    --to=snakebyte@gmx.de \
    --cc=andy@andynet.net \
    --cc=linux-kernel@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.