If oss_hw_constraint() returns error, we leak 'oss' object and all the
resources referenced by it. This patch fixes the issue by jumping to
'error' label where the proper clean up is already done.
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
if ((err = oss_hw_constraint(oss)) < 0) {
snd_pcm_ioplug_delete(&oss->io);
- return err;
+ goto error;
}
*pcmp = oss->io.pcm;