mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 04:01:48 -04:00
ALSA: pcsp: Use common error handling code in snd_card_pcsp_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: Markus Elfring <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
This commit is contained in:
parent
e8a91ae18b
commit
2cded8c891
1 changed files with 13 additions and 16 deletions
|
|
@ -108,22 +108,17 @@ static int snd_card_pcsp_probe(int devnum, struct device *dev)
|
|||
return err;
|
||||
|
||||
err = snd_pcsp_create(card);
|
||||
if (err < 0) {
|
||||
snd_card_free(card);
|
||||
return err;
|
||||
}
|
||||
if (err < 0)
|
||||
goto free_card;
|
||||
|
||||
if (!nopcm) {
|
||||
err = snd_pcsp_new_pcm(&pcsp_chip);
|
||||
if (err < 0) {
|
||||
snd_card_free(card);
|
||||
return err;
|
||||
}
|
||||
if (err < 0)
|
||||
goto free_card;
|
||||
}
|
||||
err = snd_pcsp_new_mixer(&pcsp_chip, nopcm);
|
||||
if (err < 0) {
|
||||
snd_card_free(card);
|
||||
return err;
|
||||
}
|
||||
if (err < 0)
|
||||
goto free_card;
|
||||
|
||||
strcpy(card->driver, "PC-Speaker");
|
||||
strcpy(card->shortname, "pcsp");
|
||||
|
|
@ -131,12 +126,14 @@ static int snd_card_pcsp_probe(int devnum, struct device *dev)
|
|||
pcsp_chip.port);
|
||||
|
||||
err = snd_card_register(card);
|
||||
if (err < 0) {
|
||||
snd_card_free(card);
|
||||
return err;
|
||||
}
|
||||
if (err < 0)
|
||||
goto free_card;
|
||||
|
||||
return 0;
|
||||
|
||||
free_card:
|
||||
snd_card_free(card);
|
||||
return err;
|
||||
}
|
||||
|
||||
static int alsa_card_pcsp_init(struct device *dev)
|
||||
|
|
|
|||
Loading…
Reference in a new issue