diff options
author | Paulo Marques <pmarques@grupopie.com> | 2005-06-23 03:09:02 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-23 12:45:18 -0400 |
commit | 543537bd922692bc978e2e356fcd8bfc9c2ee7d5 (patch) | |
tree | 0089e3907e7d6c17c01cffc6ea4a8962ed053079 /sound/core/oss | |
parent | 991114c6fa6a21d1fa4d544abe78592352860c82 (diff) |
[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>
Diffstat (limited to 'sound/core/oss')
-rw-r--r-- | sound/core/oss/mixer_oss.c | 3 | ||||
-rw-r--r-- | sound/core/oss/pcm_oss.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/sound/core/oss/mixer_oss.c b/sound/core/oss/mixer_oss.c index 98ed9a9f0da6..98fc0766f885 100644 --- a/sound/core/oss/mixer_oss.c +++ b/sound/core/oss/mixer_oss.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/smp_lock.h> | 24 | #include <linux/smp_lock.h> |
25 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
26 | #include <linux/time.h> | 26 | #include <linux/time.h> |
27 | #include <linux/string.h> | ||
27 | #include <sound/core.h> | 28 | #include <sound/core.h> |
28 | #include <sound/minors.h> | 29 | #include <sound/minors.h> |
29 | #include <sound/control.h> | 30 | #include <sound/control.h> |
@@ -1137,7 +1138,7 @@ static void snd_mixer_oss_proc_write(snd_info_entry_t *entry, | |||
1137 | goto __unlock; | 1138 | goto __unlock; |
1138 | } | 1139 | } |
1139 | tbl->oss_id = ch; | 1140 | tbl->oss_id = ch; |
1140 | tbl->name = snd_kmalloc_strdup(str, GFP_KERNEL); | 1141 | tbl->name = kstrdup(str, GFP_KERNEL); |
1141 | if (! tbl->name) { | 1142 | if (! tbl->name) { |
1142 | kfree(tbl); | 1143 | kfree(tbl); |
1143 | goto __unlock; | 1144 | goto __unlock; |
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c index cab30977e7c0..de7444c586f9 100644 --- a/sound/core/oss/pcm_oss.c +++ b/sound/core/oss/pcm_oss.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/time.h> | 33 | #include <linux/time.h> |
34 | #include <linux/vmalloc.h> | 34 | #include <linux/vmalloc.h> |
35 | #include <linux/moduleparam.h> | 35 | #include <linux/moduleparam.h> |
36 | #include <linux/string.h> | ||
36 | #include <sound/core.h> | 37 | #include <sound/core.h> |
37 | #include <sound/minors.h> | 38 | #include <sound/minors.h> |
38 | #include <sound/pcm.h> | 39 | #include <sound/pcm.h> |
@@ -2360,7 +2361,7 @@ static void snd_pcm_oss_proc_write(snd_info_entry_t *entry, | |||
2360 | for (setup1 = pstr->oss.setup_list; setup1->next; setup1 = setup1->next); | 2361 | for (setup1 = pstr->oss.setup_list; setup1->next; setup1 = setup1->next); |
2361 | setup1->next = setup; | 2362 | setup1->next = setup; |
2362 | } | 2363 | } |
2363 | template.task_name = snd_kmalloc_strdup(task_name, GFP_KERNEL); | 2364 | template.task_name = kstrdup(task_name, GFP_KERNEL); |
2364 | } else { | 2365 | } else { |
2365 | buffer->error = -ENOMEM; | 2366 | buffer->error = -ENOMEM; |
2366 | } | 2367 | } |