Commit 002c171a authored by Jaroslav Kysela's avatar Jaroslav Kysela

ALSA CVS update - Jaroslav Kysela <perex@suse.cz>

ALSA Core
A try to fix get_id() function - use alloc_bootmem()
parent 323754e8
......@@ -136,29 +136,27 @@ static int snd_legacy_find_free_dma(int *dma_table)
#if defined(SNDRV_GET_ID) && !defined(MODULE)
#include <linux/ctype.h>
#include <linux/init.h>
#include <linux/bootmem.h>
static int __init get_id(char **str, char **dst)
{
char *s, *d;
char *s;
if (!(*str) || !(**str))
return 0;
for (s = *str; isalpha(*s) || isdigit(*s) || *s == '_'; s++);
if (s != *str) {
*dst = (char *)kmalloc((s - *str) + 1, GFP_KERNEL);
s = *str; d = *dst;
while (isalpha(*s) || isdigit(*s) || *s == '_') {
if (d != NULL)
*d++ = *s;
s++;
int len = s - *str;
char *d = (char *)alloc_bootmem(len + 1);
if (d != NULL) {
memcpy(*dst = d, *str, len);
d[len] = '\0';
}
if (d != NULL)
*d = '\0';
}
*str = s;
if (*s == ',') {
(*str)++;
*str = s + 1;
return 2;
}
*str = s;
return 1;
}
#endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment