[PATCH] create a kstrdup library function
This patch creates a new kstrdup library function and changes the "local" implementations in several places to use this function. Most of the changes come from the sound and net subsystems. The sound part had already been acknowledged by Takashi Iwai and the net part by David S. Miller. I left UML alone for now because I would need more time to read the code carefully before making changes there. Signed-off-by: Paulo Marques <pmarques@grupopie.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
991114c6fa
commit
543537bd92
@ -24,6 +24,7 @@
|
||||
#include <linux/vmalloc.h>
|
||||
#include <linux/time.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/string.h>
|
||||
#include <sound/core.h>
|
||||
#include <sound/minors.h>
|
||||
#include <sound/info.h>
|
||||
@ -754,7 +755,7 @@ static snd_info_entry_t *snd_info_create_entry(const char *name)
|
||||
entry = kcalloc(1, sizeof(*entry), GFP_KERNEL);
|
||||
if (entry == NULL)
|
||||
return NULL;
|
||||
entry->name = snd_kmalloc_strdup(name, GFP_KERNEL);
|
||||
entry->name = kstrdup(name, GFP_KERNEL);
|
||||
if (entry->name == NULL) {
|
||||
kfree(entry);
|
||||
return NULL;
|
||||
|
Reference in New Issue
Block a user