ALSA: hdspm: Use common error handling code in snd_hdspm_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 <elfring@users.sourceforge.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Markus Elfring and committed by
Takashi Iwai
e35e9ddf 99dcad32

+8 -8
+8 -8
sound/pci/rme9652/hdspm.c
··· 6949 6949 hdspm->pci = pci; 6950 6950 6951 6951 err = snd_hdspm_create(card, hdspm); 6952 - if (err < 0) { 6953 - snd_card_free(card); 6954 - return err; 6955 - } 6952 + if (err < 0) 6953 + goto free_card; 6956 6954 6957 6955 if (hdspm->io_type != MADIface) { 6958 6956 snprintf(card->shortname, sizeof(card->shortname), "%s_%x", ··· 6968 6970 } 6969 6971 6970 6972 err = snd_card_register(card); 6971 - if (err < 0) { 6972 - snd_card_free(card); 6973 - return err; 6974 - } 6973 + if (err < 0) 6974 + goto free_card; 6975 6975 6976 6976 pci_set_drvdata(pci, card); 6977 6977 6978 6978 dev++; 6979 6979 return 0; 6980 + 6981 + free_card: 6982 + snd_card_free(card); 6983 + return err; 6980 6984 } 6981 6985 6982 6986 static void snd_hdspm_remove(struct pci_dev *pci)