diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2017-08-14 22:00:40 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2017-08-15 08:21:39 +0200 |
commit | 2675be5a004ee0d8155d2ad48cad95920f727921 (patch) | |
tree | 9c47b170307951f025047e9138fe519c2a5921ca /sound/pci/rme9652/hdsp.c | |
parent | aa5ebc7831bf3822fb3762e700dc848f3f78f728 (diff) | |
download | linux-2675be5a004ee0d8155d2ad48cad95920f727921.tar.bz2 |
ALSA: rme9652: Use common error handling code in two functions
Add a jump target so that a bit of exception handling can be better reused
in these functions.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/rme9652/hdsp.c')
-rw-r--r-- | sound/pci/rme9652/hdsp.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c index 9535e6a933eb..0ff41f9ab434 100644 --- a/sound/pci/rme9652/hdsp.c +++ b/sound/pci/rme9652/hdsp.c @@ -5381,17 +5381,16 @@ static int snd_hdsp_probe(struct pci_dev *pci, card->private_free = snd_hdsp_card_free; hdsp->dev = dev; hdsp->pci = pci; - - if ((err = snd_hdsp_create(card, hdsp)) < 0) { - snd_card_free(card); - return err; - } + err = snd_hdsp_create(card, hdsp); + if (err) + goto free_card; strcpy(card->shortname, "Hammerfall DSP"); sprintf(card->longname, "%s at 0x%lx, irq %d", hdsp->card_name, hdsp->port, hdsp->irq); - - if ((err = snd_card_register(card)) < 0) { + err = snd_card_register(card); + if (err) { +free_card: snd_card_free(card); return err; } |