summaryrefslogtreecommitdiff
path: root/sound/isa/sb/sb16_csp.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/isa/sb/sb16_csp.c')
-rw-r--r--sound/isa/sb/sb16_csp.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/sound/isa/sb/sb16_csp.c b/sound/isa/sb/sb16_csp.c
index d6ce6b16421c..dec68ae6b599 100644
--- a/sound/isa/sb/sb16_csp.c
+++ b/sound/isa/sb/sb16_csp.c
@@ -1036,6 +1036,7 @@ static const struct snd_kcontrol_new snd_sb_qsound_space = {
static int snd_sb_qsound_build(struct snd_sb_csp * p)
{
struct snd_card *card;
+ struct snd_kcontrol *kctl;
int err;
if (snd_BUG_ON(!p))
@@ -1047,18 +1048,16 @@ static int snd_sb_qsound_build(struct snd_sb_csp * p)
spin_lock_init(&p->q_lock);
- p->qsound_switch = snd_ctl_new1(&snd_sb_qsound_switch, p);
- err = snd_ctl_add(card, p->qsound_switch);
- if (err < 0) {
- p->qsound_switch = NULL;
+ kctl = snd_ctl_new1(&snd_sb_qsound_switch, p);
+ err = snd_ctl_add(card, kctl);
+ if (err < 0)
goto __error;
- }
- p->qsound_space = snd_ctl_new1(&snd_sb_qsound_space, p);
- err = snd_ctl_add(card, p->qsound_space);
- if (err < 0) {
- p->qsound_space = NULL;
+ p->qsound_switch = kctl;
+ kctl = snd_ctl_new1(&snd_sb_qsound_space, p);
+ err = snd_ctl_add(card, kctl);
+ if (err < 0)
goto __error;
- }
+ p->qsound_space = kctl;
return 0;