Takashi Iwai wrote: > At Tue, 01 Feb 2005 13:07:25 +0000, > Paulo Marques wrote: > >>I thought of going all the way and changing the callers of kstrdup in >>sound to use kfree, so that it would work without debugging memory >>allocated for strdup'ed strings. >> >>However the code there already uses kfree, just not the standard kfree >>because it might have been defined to something else in core.h if >>CONFIG_SND_DEBUG_MEMORY is set. >> >>We could still go all the way and carry on with this approach: use the >>standard kstrdup / kfree when not CONFIG_SND_DEBUG_MEMORY, and define >>kstrdup to be an internal sound function in sound/core/memory.c when >>CONFIG_SND_DEBUG_MEMORY is set. > > > This sounds good. We can do just like normal kmalloc: > > #ifdef CONFIG_SND_DEBUG_MEMORY > ... > #define kstrdup(s) my_kstrdup_wrapper(s) > #endif > > >>Do you prefer that I do another patch to do this, or that I just drop >>the patch and leave snd_kmalloc_strdup alone? > > > Heh, it's up to you ;) Using kstrdup() in normal cases would be > better, of course. Ok, how about this patch, then? This was just compile-tested (with and without CONFIG_SND_DEBUG_MEMORY), but it seems correct... -- Paulo Marques - www.grupopie.com All that is necessary for the triumph of evil is that good men do nothing. Edmund Burke (1729 - 1797)