diff options
author | Julia Lawall <Julia.Lawall@lip6.fr> | 2015-04-05 08:06:33 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-04-05 12:04:27 -0400 |
commit | 646cb6dae4994eb332ddf7376520eed255c5a8b4 (patch) | |
tree | 8b16d697b749a8096a92db3367615a02b453bfab /sound/mips | |
parent | eab0fbfa41040f4f76b173cad17c0c8ed40cba33 (diff) |
ALSA: au1x00: fix error return code
Return a negative error code on failure.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
identifier ret; expression e1,e2;
@@
(
if (\(ret < 0\|ret != 0\))
{ ... return ret; }
|
ret = 0
)
... when != ret = e1
when != &ret
*if(...)
{
... when != ret = e2
when forall
return ret;
}
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/mips')
-rw-r--r-- | sound/mips/au1x00.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sound/mips/au1x00.c b/sound/mips/au1x00.c index fbcaa5434fd8..1e30e8475431 100644 --- a/sound/mips/au1x00.c +++ b/sound/mips/au1x00.c | |||
@@ -633,19 +633,25 @@ static int au1000_ac97_probe(struct platform_device *pdev) | |||
633 | 633 | ||
634 | au1000->stream[PLAYBACK] = kmalloc(sizeof(struct audio_stream), | 634 | au1000->stream[PLAYBACK] = kmalloc(sizeof(struct audio_stream), |
635 | GFP_KERNEL); | 635 | GFP_KERNEL); |
636 | if (!au1000->stream[PLAYBACK]) | 636 | if (!au1000->stream[PLAYBACK]) { |
637 | err = -ENOMEM; | ||
637 | goto out; | 638 | goto out; |
639 | } | ||
638 | au1000->stream[PLAYBACK]->dma = -1; | 640 | au1000->stream[PLAYBACK]->dma = -1; |
639 | 641 | ||
640 | au1000->stream[CAPTURE] = kmalloc(sizeof(struct audio_stream), | 642 | au1000->stream[CAPTURE] = kmalloc(sizeof(struct audio_stream), |
641 | GFP_KERNEL); | 643 | GFP_KERNEL); |
642 | if (!au1000->stream[CAPTURE]) | 644 | if (!au1000->stream[CAPTURE]) { |
645 | err = -ENOMEM; | ||
643 | goto out; | 646 | goto out; |
647 | } | ||
644 | au1000->stream[CAPTURE]->dma = -1; | 648 | au1000->stream[CAPTURE]->dma = -1; |
645 | 649 | ||
646 | r = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 650 | r = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
647 | if (!r) | 651 | if (!r) { |
652 | err = -ENODEV; | ||
648 | goto out; | 653 | goto out; |
654 | } | ||
649 | 655 | ||
650 | err = -EBUSY; | 656 | err = -EBUSY; |
651 | au1000->ac97_res_port = request_mem_region(r->start, resource_size(r), | 657 | au1000->ac97_res_port = request_mem_region(r->start, resource_size(r), |