Commit a5a3973da8b52944bc5909852714e55771c31ce7

Authored by Julia Lawall
Committed by Takashi Iwai
1 parent 96b6359779

ALSA: azt3328 - adjust error handling code to include debugging code

snd_azf3328_dbgcallenter is called at the very beginning of the function,
so it could be useful to call snd_azf3328_dbgcallleave at all exit points.

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

Showing 1 changed file with 7 additions and 4 deletions Side-by-side Diff

... ... @@ -2625,16 +2625,19 @@
2625 2625 int err;
2626 2626  
2627 2627 snd_azf3328_dbgcallenter();
2628   - if (dev >= SNDRV_CARDS)
2629   - return -ENODEV;
  2628 + if (dev >= SNDRV_CARDS) {
  2629 + err = -ENODEV;
  2630 + goto out;
  2631 + }
2630 2632 if (!enable[dev]) {
2631 2633 dev++;
2632   - return -ENOENT;
  2634 + err = -ENOENT;
  2635 + goto out;
2633 2636 }
2634 2637  
2635 2638 err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
2636 2639 if (err < 0)
2637   - return err;
  2640 + goto out;
2638 2641  
2639 2642 strcpy(card->driver, "AZF3328");
2640 2643 strcpy(card->shortname, "Aztech AZF3328 (PCI168)");