ucm: Set uc_mgr->ctl to NULL after closing it.

Fixes a double-free bug.

Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Tanu Kaskinen 2013-01-26 14:20:20 +02:00 committed by Takashi Iwai
parent b11911dddf
commit 1629e2fbf3

View file

@ -145,6 +145,7 @@ static int open_ctl(snd_use_case_mgr_t *uc_mgr,
free(uc_mgr->ctl_dev);
uc_mgr->ctl_dev = NULL;
snd_ctl_close(uc_mgr->ctl);
uc_mgr->ctl = NULL;
}
err = snd_ctl_open(ctl, ctl_dev, 0);