Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4d361285925613516560f81f8c7fc96b89c8b1a8 Commit: 4d361285925613516560f81f8c7fc96b89c8b1a8 Parent: c13893d7be4f159b359a1b7ee46b3646ecb2fe20 Author: Akinobu Mita <[EMAIL PROTECTED]> AuthorDate: Thu Nov 23 12:03:24 2006 +0100 Committer: Jaroslav Kysela <[EMAIL PROTECTED]> CommitDate: Wed Dec 20 08:56:00 2006 +0100
[ALSA] sound: fix PCM substream list 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. Signed-off-by: Akinobu Mita <[EMAIL PROTECTED]> Signed-off-by: Takashi Iwai <[EMAIL PROTECTED]> Signed-off-by: Jaroslav Kysela <[EMAIL PROTECTED]> --- sound/core/pcm.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/sound/core/pcm.c b/sound/core/pcm.c index 5ac6e19..8e01898 100644 --- a/sound/core/pcm.c +++ b/sound/core/pcm.c @@ -640,6 +640,10 @@ int snd_pcm_new_stream(struct snd_pcm *pcm, int stream, int substream_count) 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; } - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html