[alsa-devel] snd_array_free - snd: bad kfree when HDA reconfig

Raymond Yau superquad.vortex2 at gmail.com
Thu Sep 15 16:23:12 CEST 2011


2011/9/14 Takashi Iwai <tiwai at suse.de>:
>
> Try the patch below in addition to the previous one.
>
>
> thanks,
>
> Takashi
>
> ---
> From: Takashi Iwai <tiwai at suse.de>
> Subject: [PATCH] Add missing export of snd_hidden_ksize()
>
> Also fix the ifdef of krealloc() wrapper for some corner cases.
>
> Signed-off-by: Takashi Iwai <tiwai at suse.de>
> ---
>  acore/sound.inc   |    1 +
>  include/adriver.h |    3 ++-
>  2 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/acore/sound.inc b/acore/sound.inc
> index a79755e..2e63c98 100644
> --- a/acore/sound.inc
> +++ b/acore/sound.inc
> @@ -3,6 +3,7 @@
>  EXPORT_SYMBOL(snd_hidden_kmalloc);
>  EXPORT_SYMBOL(snd_hidden_kzalloc);
>  EXPORT_SYMBOL(snd_hidden_kcalloc);
> +EXPORT_SYMBOL(snd_hidden_ksize);
>  EXPORT_SYMBOL(snd_hidden_kfree);
>  EXPORT_SYMBOL(snd_hidden_kstrdup);
>  EXPORT_SYMBOL(snd_hidden_kstrndup);
> diff --git a/include/adriver.h b/include/adriver.h
> index fe70442..848bc17 100644
> --- a/include/adriver.h
> +++ b/include/adriver.h
> @@ -2002,7 +2002,8 @@ static inline bool flush_delayed_work_sync(struct delayed_work *dwork)
>  #endif
>
>  /* krealloc() wrapper */
> -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22)) || defined(CONFIG_SND_DEBUG_MEMORY)
> +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22)) || \
> +       (defined(CONFIG_SND_DEBUG_MEMORY) && !defined(SKIP_HIDDEN_MALLOCS))
>  #include <linux/slab.h>
>  static inline void *snd_compat_krealloc(const void *p, size_t new_size, gfp_t flags)
>  {
> --
> 1.7.6.1
>
>

your patch fix the problem

BTW, there is some strange behaviour of the non-sticky pcm
implementation on ad1988

Refer to commit 0e7adbe263f89ea2ef15b5af5e80a812b2a85025

Disable sticky PCM stream assignment for AD codecs

why hda_codec_cleanup_stream is called twice  and this also occur with
capture and playback


ALSA hda_intel.c:1755: azx_pcm_prepare: bufsize=0x10000, format=0x4011
ALSA hda_codec.c:1408: hda_codec_setup_stream: NID=0x4, stream=0x5,
channel=0, format=0x4011
ALSA hda_codec.c:1408: hda_codec_setup_stream: NID=0x3, stream=0x5,
channel=0, format=0x4011
ALSA hda_codec.c:1408: hda_codec_setup_stream: NID=0x6, stream=0x5,
channel=0, format=0x4011
ALSA hda_codec.c:1408: hda_codec_setup_stream: NID=0x5, stream=0x5,
channel=0, format=0x4011
ALSA hda_codec.c:1408: hda_codec_setup_stream: NID=0xa, stream=0x5,
channel=0, format=0x4011
ALSA hda_codec.c:1471: hda_codec_cleanup_stream: NID=0x4
ALSA hda_codec.c:1471: hda_codec_cleanup_stream: NID=0x6
ALSA hda_codec.c:1471: hda_codec_cleanup_stream: NID=0x5
ALSA hda_codec.c:1471: hda_codec_cleanup_stream: NID=0xa
ALSA hda_codec.c:1471: hda_codec_cleanup_stream: NID=0x3
ALSA hda_codec.c:1471: hda_codec_cleanup_stream: NID=0x4
ALSA hda_codec.c:1471: hda_codec_cleanup_stream: NID=0x6
ALSA hda_codec.c:1471: hda_codec_cleanup_stream: NID=0x5
ALSA hda_codec.c:1471: hda_codec_cleanup_stream: NID=0xa
ALSA hda_codec.c:1471: hda_codec_cleanup_stream: NID=0x3



ALSA hda_intel.c:1755: azx_pcm_prepare: bufsize=0x10000, format=0x4011
ALSA hda_codec.c:1408: hda_codec_setup_stream: NID=0x8, stream=0x1,
channel=0, format=0x4011
ALSA hda_codec.c:1471: hda_codec_cleanup_stream: NID=0x8
ALSA hda_codec.c:1471: hda_codec_cleanup_stream: NID=0x8


More information about the Alsa-devel mailing list