aboutsummaryrefslogtreecommitdiffstats
path: root/sound/oss
diff options
context:
space:
mode:
Diffstat (limited to 'sound/oss')
-rw-r--r--sound/oss/uart401.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sound/oss/uart401.c b/sound/oss/uart401.c
index 8e514a676a0d..5433c6f5eca2 100644
--- a/sound/oss/uart401.c
+++ b/sound/oss/uart401.c
@@ -352,23 +352,26 @@ int probe_uart401(struct address_info *hw_config, struct module *owner)
352 goto cleanup_irq; 352 goto cleanup_irq;
353 } 353 }
354 conf_printf(name, hw_config); 354 conf_printf(name, hw_config);
355 midi_devs[devc->my_dev] = kmalloc(sizeof(struct midi_operations), GFP_KERNEL); 355 midi_devs[devc->my_dev] = kmemdup(&uart401_operations,
356 sizeof(struct midi_operations),
357 GFP_KERNEL);
356 if (!midi_devs[devc->my_dev]) { 358 if (!midi_devs[devc->my_dev]) {
357 printk(KERN_ERR "uart401: Failed to allocate memory\n"); 359 printk(KERN_ERR "uart401: Failed to allocate memory\n");
358 goto cleanup_unload_mididev; 360 goto cleanup_unload_mididev;
359 } 361 }
360 memcpy(midi_devs[devc->my_dev], &uart401_operations, sizeof(struct midi_operations));
361 362
362 if (owner) 363 if (owner)
363 midi_devs[devc->my_dev]->owner = owner; 364 midi_devs[devc->my_dev]->owner = owner;
364 365
365 midi_devs[devc->my_dev]->devc = devc; 366 midi_devs[devc->my_dev]->devc = devc;
366 midi_devs[devc->my_dev]->converter = kmalloc(sizeof(struct synth_operations), GFP_KERNEL); 367 midi_devs[devc->my_dev]->converter = kmemdup(&std_midi_synth,
368 sizeof(struct synth_operations),
369 GFP_KERNEL);
370
367 if (!midi_devs[devc->my_dev]->converter) { 371 if (!midi_devs[devc->my_dev]->converter) {
368 printk(KERN_WARNING "uart401: Failed to allocate memory\n"); 372 printk(KERN_WARNING "uart401: Failed to allocate memory\n");
369 goto cleanup_midi_devs; 373 goto cleanup_midi_devs;
370 } 374 }
371 memcpy(midi_devs[devc->my_dev]->converter, &std_midi_synth, sizeof(struct synth_operations));
372 strcpy(midi_devs[devc->my_dev]->info.name, name); 375 strcpy(midi_devs[devc->my_dev]->info.name, name);
373 midi_devs[devc->my_dev]->converter->id = "UART401"; 376 midi_devs[devc->my_dev]->converter->id = "UART401";
374 midi_devs[devc->my_dev]->converter->midi_dev = devc->my_dev; 377 midi_devs[devc->my_dev]->converter->midi_dev = devc->my_dev;