From: Eric Sesterhenn Date: Tue, 10 Oct 2006 21:42:50 +0000 (-0700) Subject: USB: Memory leak in drivers/usb/serial/airprime.c X-Git-Tag: v2.6.19-rc3~137^2~10 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e185b7922ac81516c5c4653dcf6aacbf6341e73;p=linux-2.6 USB: Memory leak in drivers/usb/serial/airprime.c 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 Acked-by: Andy Gay Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/serial/airprime.c b/drivers/usb/serial/airprime.c index 392a5129af..ba93c72cdb 100644 --- a/drivers/usb/serial/airprime.c +++ b/drivers/usb/serial/airprime.c @@ -134,6 +134,7 @@ static int airprime_open(struct usb_serial_port *port, struct file *filp) } urb = usb_alloc_urb(0, GFP_KERNEL); if (!urb) { + kfree(buffer); dev_err(&port->dev, "%s - no more urbs?\n", __FUNCTION__); result = -ENOMEM;