Commit 0f25e000 authored by Kangjie Lu's avatar Kangjie Lu Committed by Takashi Iwai

ALSA: gus: add a check of the status of snd_ctl_add

snd_ctl_add() could fail, so let's check its status and issue an error
message if it indeed fails.
Signed-off-by: default avatarKangjie Lu <kjlu@umn.edu>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 4bccb403
...@@ -92,8 +92,17 @@ static const struct snd_kcontrol_new snd_gus_joystick_control = { ...@@ -92,8 +92,17 @@ static const struct snd_kcontrol_new snd_gus_joystick_control = {
static void snd_gus_init_control(struct snd_gus_card *gus) static void snd_gus_init_control(struct snd_gus_card *gus)
{ {
if (!gus->ace_flag) int ret;
snd_ctl_add(gus->card, snd_ctl_new1(&snd_gus_joystick_control, gus));
if (!gus->ace_flag) {
ret =
snd_ctl_add(gus->card,
snd_ctl_new1(&snd_gus_joystick_control,
gus));
if (ret)
snd_printk(KERN_ERR "gus: snd_ctl_add failed: %d\n",
ret);
}
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment