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

ALSA: cmipci: Use common error handling code in snd_cmipci_probe()

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>
上级 62a93947
......@@ -3295,20 +3295,23 @@ static int snd_cmipci_probe(struct pci_dev *pci,
break;
}
if ((err = snd_cmipci_create(card, pci, dev, &cm)) < 0) {
snd_card_free(card);
return err;
}
err = snd_cmipci_create(card, pci, dev, &cm);
if (err < 0)
goto free_card;
card->private_data = cm;
if ((err = snd_card_register(card)) < 0) {
snd_card_free(card);
return err;
}
err = snd_card_register(card);
if (err < 0)
goto free_card;
pci_set_drvdata(pci, card);
dev++;
return 0;
free_card:
snd_card_free(card);
return err;
}
static void snd_cmipci_remove(struct pci_dev *pci)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册