vserver 2.0 rc7
[linux-2.6.git] / sound / isa / gus / gus_synth.c
index c7ff304..66552e6 100644 (file)
@@ -214,7 +214,7 @@ static int snd_gus_synth_new_device(snd_seq_device_t *dev)
        snd_gus_card_t *gus;
        int client, i;
        snd_seq_client_callback_t callbacks;
-       snd_seq_client_info_t cinfo;
+       snd_seq_client_info_t *cinfo;
        snd_seq_port_subscribe_t sub;
        snd_iwffff_ops_t *iwops;
        snd_gf1_ops_t *gf1ops;
@@ -227,21 +227,28 @@ static int snd_gus_synth_new_device(snd_seq_device_t *dev)
        init_MUTEX(&gus->register_mutex);
        gus->gf1.seq_client = -1;
        
+       cinfo = kmalloc(sizeof(*cinfo), GFP_KERNEL);
+       if (! cinfo)
+               return -ENOMEM;
+
        /* allocate new client */
        memset(&callbacks, 0, sizeof(callbacks));
        callbacks.private_data = gus;
        callbacks.allow_output = callbacks.allow_input = 1;
        client = gus->gf1.seq_client =
                        snd_seq_create_kernel_client(gus->card, 1, &callbacks);
-       if (client < 0)
+       if (client < 0) {
+               kfree(cinfo);
                return client;
+       }
 
        /* change name of client */
-       memset(&cinfo, 0, sizeof(cinfo));
-       cinfo.client = client;
-       cinfo.type = KERNEL_CLIENT;
-       sprintf(cinfo.name, gus->interwave ? "AMD InterWave" : "GF1");
-       snd_seq_kernel_client_ctl(client, SNDRV_SEQ_IOCTL_SET_CLIENT_INFO, &cinfo);
+       memset(cinfo, 0, sizeof(*cinfo));
+       cinfo->client = client;
+       cinfo->type = KERNEL_CLIENT;
+       sprintf(cinfo->name, gus->interwave ? "AMD InterWave" : "GF1");
+       snd_seq_kernel_client_ctl(client, SNDRV_SEQ_IOCTL_SET_CLIENT_INFO, cinfo);
+       kfree(cinfo);
 
        for (i = 0; i < 4; i++)
                snd_gus_synth_create_port(gus, i);