|
@@ -604,14 +604,13 @@ int hiface_pcm_init(struct hiface_chip *chip, u8 extra_freq)
|
|
|
ret = hiface_pcm_init_urb(&rt->out_urbs[i], chip, OUT_EP,
|
|
ret = hiface_pcm_init_urb(&rt->out_urbs[i], chip, OUT_EP,
|
|
|
hiface_pcm_out_urb_handler);
|
|
hiface_pcm_out_urb_handler);
|
|
|
if (ret < 0)
|
|
if (ret < 0)
|
|
|
- return ret;
|
|
|
|
|
|
|
+ goto error;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
ret = snd_pcm_new(chip->card, "USB-SPDIF Audio", 0, 1, 0, &pcm);
|
|
ret = snd_pcm_new(chip->card, "USB-SPDIF Audio", 0, 1, 0, &pcm);
|
|
|
if (ret < 0) {
|
|
if (ret < 0) {
|
|
|
- kfree(rt);
|
|
|
|
|
dev_err(&chip->dev->dev, "Cannot create pcm instance\n");
|
|
dev_err(&chip->dev->dev, "Cannot create pcm instance\n");
|
|
|
- return ret;
|
|
|
|
|
|
|
+ goto error;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
pcm->private_data = rt;
|
|
pcm->private_data = rt;
|
|
@@ -624,4 +623,10 @@ int hiface_pcm_init(struct hiface_chip *chip, u8 extra_freq)
|
|
|
|
|
|
|
|
chip->pcm = rt;
|
|
chip->pcm = rt;
|
|
|
return 0;
|
|
return 0;
|
|
|
|
|
+
|
|
|
|
|
+error:
|
|
|
|
|
+ for (i = 0; i < PCM_N_URBS; i++)
|
|
|
|
|
+ kfree(rt->out_urbs[i].buffer);
|
|
|
|
|
+ kfree(rt);
|
|
|
|
|
+ return ret;
|
|
|
}
|
|
}
|