If a52_set_hw_constraint() returns error, we leak 'rec' and
'rec->slave'. 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 = a52_set_hw_constraint(rec)) < 0) {
snd_pcm_ioplug_delete(&rec->io);
- return err;
+ goto error;
}
*pcmp = rec->io.pcm;