vserver 1.9.3
[linux-2.6.git] / sound / pci / cs46xx / dsp_spos_scb_lib.c
index 3100d00..4bf170b 100644 (file)
@@ -69,7 +69,7 @@ static void cs46xx_dsp_proc_scb_info_read (snd_info_entry_t *entry, snd_info_buf
        proc_scb_info_t * scb_info  = (proc_scb_info_t *)entry->private_data;
        dsp_scb_descriptor_t * scb = scb_info->scb_desc;
        dsp_spos_instance_t * ins;
-       cs46xx_t *chip = snd_magic_cast(cs46xx_t, scb_info->chip, return);
+       cs46xx_t *chip = scb_info->chip;
        int j,col;
        unsigned long dst = chip->region.idx[1].remap_addr + DSP_PARAMETER_BYTE_OFFSET;
 
@@ -246,6 +246,12 @@ void cs46xx_dsp_proc_register_scb_desc (cs46xx_t *chip,dsp_scb_descriptor_t * sc
                if ((entry = snd_info_create_card_entry(ins->snd_card, scb->scb_name, 
                                                        ins->proc_dsp_dir)) != NULL) {
                        scb_info = kmalloc(sizeof(proc_scb_info_t), GFP_KERNEL);
+                       if (!scb_info) {
+                               snd_info_free_entry(entry);
+                               entry = NULL;
+                               goto out;
+                       }
+
                        scb_info->chip = chip;
                        scb_info->scb_desc = scb;
       
@@ -262,7 +268,7 @@ void cs46xx_dsp_proc_register_scb_desc (cs46xx_t *chip,dsp_scb_descriptor_t * sc
                                entry = NULL;
                        }
                }
-
+out:
                scb->proc_info = entry;
        }
 }