lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 15 Aug 2007 21:49:13 +0200
From:	"Markus Rechberger" <mrechberger@...il.com>
To:	"Jesper Juhl" <jesper.juhl@...il.com>
Cc:	"Linux Kernel Mailing List" <linux-kernel@...r.kernel.org>,
	"Luca Risolia" <luca.risolia@...dio.unibo.it>,
	"Ludovico Cavedon" <cavedon@...up.it>,
	"Mauro Carvalho Chehab" <mchehab@...radead.org>,
	"Sascha Sommer" <saschasommer@...enet.de>,
	"Greg Kroah-Hartman" <greg@...ah.com>
Subject: Re: [PATCH] Fix a memory leak in em28xx_usb_probe()

Hi Jesper,

On 8/9/07, Jesper Juhl <jesper.juhl@...il.com> wrote:
> EHLO,
>
> If, in em28xx_usb_probe() the memory allocation
> 	dev->alt_max_pkt_size = kmalloc(32*
> 						dev->num_alt,GFP_KERNEL);
> fails, then we'll bail out and return -ENOMEM.
> The problem is that in that case we don't free the storage allocated
> to 'dev', thus causing a memory leak.
>
> This patch fixes the leak by freeing 'dev' before we return -ENOMEM.
> This fixes Coverity bug #647.
>
>
> Signed-off-by: Jesper Juhl <jesper.juhl@...il.com>

Acked-by: Markus Rechberger <mrechberger@...il.com>

thanks,
Markus

> ---
>
>  drivers/media/video/em28xx/em28xx-video.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/media/video/em28xx/em28xx-video.c
> b/drivers/media/video/em28xx/em28xx-video.c
> index 2c7b158..40307f3 100644
> --- a/drivers/media/video/em28xx/em28xx-video.c
> +++ b/drivers/media/video/em28xx/em28xx-video.c
> @@ -1772,6 +1772,7 @@ static int em28xx_usb_probe(struct usb_interface
> *interface,
>  	if (dev->alt_max_pkt_size == NULL) {
>  		em28xx_errdev("out of memory!\n");
>  		em28xx_devused&=~(1<<nr);
> +		kfree(dev);
>  		return -ENOMEM;
>  	}
>
>
>
>
>


-- 
Markus Rechberger
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ