mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Akinobu Mita <akinobu.mita@gmail.com>
Cc: linux-kernel@vger.kernel.org, Jaroslav Kysela <perex@suse.cz>
Subject: Re: [PATCH] sound: fix PCM substream list
Date: Thu, 23 Nov 2006 12:06:48 +0100	[thread overview]
Message-ID: <s5h8xi2h16f.wl%tiwai@suse.de> (raw)
In-Reply-To: <20061122185145.GF2985@APFDCB5C>

At Thu, 23 Nov 2006 03:51:45 +0900,
Akinobu Mita wrote:
> 
> If snd_pcm_new_stream() fails to initalize a substream (if
> snd_pcm_substream_proc_init() returns error), snd_pcm_new_stream()
> immediately return without unlinking that kfree()d substram.
> 
> It causes oops when snd_pcm_free() iterates the list of substream to
> free them by invalid reference.
> 
> Cc: Takashi Iwai <tiwai@suse.de>
> Cc: Jaroslav Kysela <perex@suse.cz>
> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>

Merged this one to ALSA tree, too.
Thanks.


Takashi

> 
> ---
>  sound/core/pcm.c |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> Index: work-fault-inject/sound/core/pcm.c
> ===================================================================
> --- work-fault-inject.orig/sound/core/pcm.c
> +++ work-fault-inject/sound/core/pcm.c
> @@ -638,6 +638,10 @@ int snd_pcm_new_stream(struct snd_pcm *p
>  		err = snd_pcm_substream_proc_init(substream);
>  		if (err < 0) {
>  			snd_printk(KERN_ERR "Error in snd_pcm_stream_proc_init\n");
> +			if (prev == NULL)
> +				pstr->substream = NULL;
> +			else
> +				prev->next = NULL;
>  			kfree(substream);
>  			return err;
>  		}
> 

      reply	other threads:[~2006-11-23 11:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-22 18:51 Akinobu Mita
2006-11-23 11:06 ` Takashi Iwai [this message]

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=s5h8xi2h16f.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=akinobu.mita@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@suse.cz \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®