summaryrefslogtreecommitdiffstats
path: root/sound/pci/rme9652/rme9652.c
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2017-08-14 22:00:40 +0200
committerTakashi Iwai <tiwai@suse.de>2017-08-15 08:21:39 +0200
commit2675be5a004ee0d8155d2ad48cad95920f727921 (patch)
tree9c47b170307951f025047e9138fe519c2a5921ca /sound/pci/rme9652/rme9652.c
parentALSA: wss: constify snd_pcm_ops structures (diff)
downloadlinux-2675be5a004ee0d8155d2ad48cad95920f727921.tar.xz
linux-2675be5a004ee0d8155d2ad48cad95920f727921.zip
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 '')
-rw-r--r--sound/pci/rme9652/rme9652.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/sound/pci/rme9652/rme9652.c b/sound/pci/rme9652/rme9652.c
index eff499355b52..df648b1d9217 100644
--- a/sound/pci/rme9652/rme9652.c
+++ b/sound/pci/rme9652/rme9652.c
@@ -2618,19 +2618,17 @@ static int snd_rme9652_probe(struct pci_dev *pci,
card->private_free = snd_rme9652_card_free;
rme9652->dev = dev;
rme9652->pci = pci;
-
- if ((err = snd_rme9652_create(card, rme9652, precise_ptr[dev])) < 0) {
- snd_card_free(card);
- return err;
- }
+ err = snd_rme9652_create(card, rme9652, precise_ptr[dev]);
+ if (err)
+ goto free_card;
strcpy(card->shortname, rme9652->card_name);
sprintf(card->longname, "%s at 0x%lx, irq %d",
card->shortname, rme9652->port, rme9652->irq);
-
-
- if ((err = snd_card_register(card)) < 0) {
+ err = snd_card_register(card);
+ if (err) {
+free_card:
snd_card_free(card);
return err;
}