aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/sound/core.h2
-rw-r--r--sound/core/sound.c3
2 files changed, 1 insertions, 4 deletions
diff --git a/include/sound/core.h b/include/sound/core.h
index 5d184be0ff72..bab3ff457e40 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -188,8 +188,6 @@ struct snd_minor {
188 int device; /* device number */ 188 int device; /* device number */
189 const struct file_operations *f_ops; /* file operations */ 189 const struct file_operations *f_ops; /* file operations */
190 void *private_data; /* private data for f_ops->open */ 190 void *private_data; /* private data for f_ops->open */
191 char name[0]; /* device name (keep at the end of
192 structure) */
193}; 191};
194 192
195/* sound.c */ 193/* sound.c */
diff --git a/sound/core/sound.c b/sound/core/sound.c
index 264f2efd1af8..7edd1fc58b17 100644
--- a/sound/core/sound.c
+++ b/sound/core/sound.c
@@ -244,7 +244,7 @@ int snd_register_device(int type, struct snd_card *card, int dev,
244 struct device *device = NULL; 244 struct device *device = NULL;
245 245
246 snd_assert(name, return -EINVAL); 246 snd_assert(name, return -EINVAL);
247 preg = kmalloc(sizeof(struct snd_minor) + strlen(name) + 1, GFP_KERNEL); 247 preg = kmalloc(sizeof *preg, GFP_KERNEL);
248 if (preg == NULL) 248 if (preg == NULL)
249 return -ENOMEM; 249 return -ENOMEM;
250 preg->type = type; 250 preg->type = type;
@@ -252,7 +252,6 @@ int snd_register_device(int type, struct snd_card *card, int dev,
252 preg->device = dev; 252 preg->device = dev;
253 preg->f_ops = f_ops; 253 preg->f_ops = f_ops;
254 preg->private_data = private_data; 254 preg->private_data = private_data;
255 strcpy(preg->name, name);
256 mutex_lock(&sound_mutex); 255 mutex_lock(&sound_mutex);
257#ifdef CONFIG_SND_DYNAMIC_MINORS 256#ifdef CONFIG_SND_DYNAMIC_MINORS
258 minor = snd_find_free_minor(); 257 minor = snd_find_free_minor();