All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rene Herman <rene.herman@gmail.com>
To: Jesper Juhl <jesper.juhl@gmail.com>
Cc: alsa-devel@alsa-project.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Manuel Jander <mjander@embedded.cl>
Subject: Re: [PATCH] au88x0: mem leak fix in snd_vortex_create()
Date: Sat, 04 Aug 2007 11:47:23 +0200	[thread overview]
Message-ID: <46B44B2B.7050609@gmail.com> (raw)
In-Reply-To: <200708040209.25589.jesper.juhl@gmail.com>

On 08/04/2007 02:09 AM, Jesper Juhl wrote:

> In sound/pci/au88x0/au88x0.c::snd_vortex_create() : 
> The Coverity checker found that if we allocate storage for 'chip' 
> but then leave via the  regions_out:  label, then we end up leaking 
> the storage allocated for 'chip'.
> I believe simply freeing 'chip' before the "return err;" line is 
> all we need to fix this, but please double-check me :)
> 
> 
> Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
> ---
> 
> diff --git a/sound/pci/au88x0/au88x0.c b/sound/pci/au88x0/au88x0.c
> index 5ec1b6f..f70286a 100644
> --- a/sound/pci/au88x0/au88x0.c
> +++ b/sound/pci/au88x0/au88x0.c
> @@ -232,6 +232,7 @@ snd_vortex_create(struct snd_card *card, struct pci_dev *pci, vortex_t ** rchip)
>  	pci_disable_device(chip->pci_dev);
>  	//FIXME: this not the right place to unregister the gameport
>  	vortex_gameport_unregister(chip);
> +	kfree(chip);
>  	return err;
>  }

ACK.

Rene.

WARNING: multiple messages have this Message-ID (diff)
From: Rene Herman <rene.herman@gmail.com>
To: Jesper Juhl <jesper.juhl@gmail.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Manuel Jander <mjander@embedded.cl>,
	alsa-devel@alsa-project.org
Subject: Re: [PATCH] au88x0: mem leak fix in snd_vortex_create()
Date: Sat, 04 Aug 2007 11:47:23 +0200	[thread overview]
Message-ID: <46B44B2B.7050609@gmail.com> (raw)
In-Reply-To: <200708040209.25589.jesper.juhl@gmail.com>

On 08/04/2007 02:09 AM, Jesper Juhl wrote:

> In sound/pci/au88x0/au88x0.c::snd_vortex_create() : 
> The Coverity checker found that if we allocate storage for 'chip' 
> but then leave via the  regions_out:  label, then we end up leaking 
> the storage allocated for 'chip'.
> I believe simply freeing 'chip' before the "return err;" line is 
> all we need to fix this, but please double-check me :)
> 
> 
> Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
> ---
> 
> diff --git a/sound/pci/au88x0/au88x0.c b/sound/pci/au88x0/au88x0.c
> index 5ec1b6f..f70286a 100644
> --- a/sound/pci/au88x0/au88x0.c
> +++ b/sound/pci/au88x0/au88x0.c
> @@ -232,6 +232,7 @@ snd_vortex_create(struct snd_card *card, struct pci_dev *pci, vortex_t ** rchip)
>  	pci_disable_device(chip->pci_dev);
>  	//FIXME: this not the right place to unregister the gameport
>  	vortex_gameport_unregister(chip);
> +	kfree(chip);
>  	return err;
>  }

ACK.

Rene.

  reply	other threads:[~2007-08-04  9:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-04  0:09 [PATCH] au88x0: mem leak fix in snd_vortex_create() Jesper Juhl
2007-08-04  9:47 ` Rene Herman [this message]
2007-08-04  9:47   ` Rene Herman
2007-08-06 12:06 ` Takashi Iwai
2007-08-06 12:06   ` Takashi Iwai

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=46B44B2B.7050609@gmail.com \
    --to=rene.herman@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=jesper.juhl@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjander@embedded.cl \
    /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.