提交 80753cdf 编写于 作者: M Markus Elfring 提交者: Takashi Iwai

ALSA: us122l: Use common error handling code in us122l_create_card()

Add a jump target so that a bit of exception handling can be better reused
at the end of this function.

This issue was detected by using the Coccinelle software.
Signed-off-by: NMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 e35e9ddf
...@@ -508,8 +508,7 @@ static bool us122l_create_card(struct snd_card *card) ...@@ -508,8 +508,7 @@ static bool us122l_create_card(struct snd_card *card)
err = us122l_create_usbmidi(card); err = us122l_create_usbmidi(card);
if (err < 0) { if (err < 0) {
snd_printk(KERN_ERR "us122l_create_usbmidi error %i \n", err); snd_printk(KERN_ERR "us122l_create_usbmidi error %i \n", err);
us122l_stop(us122l); goto stop;
return false;
} }
err = usb_stream_hwdep_new(card); err = usb_stream_hwdep_new(card);
if (err < 0) { if (err < 0) {
...@@ -518,10 +517,13 @@ static bool us122l_create_card(struct snd_card *card) ...@@ -518,10 +517,13 @@ static bool us122l_create_card(struct snd_card *card)
list_for_each(p, &us122l->midi_list) list_for_each(p, &us122l->midi_list)
snd_usbmidi_disconnect(p); snd_usbmidi_disconnect(p);
us122l_stop(us122l); goto stop;
return false;
} }
return true; return true;
stop:
us122l_stop(us122l);
return false;
} }
static void snd_us122l_free(struct snd_card *card) static void snd_us122l_free(struct snd_card *card)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册