Commit 646cb6da authored by Julia Lawall's avatar Julia Lawall Committed by Takashi Iwai

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: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent eab0fbfa
...@@ -633,19 +633,25 @@ static int au1000_ac97_probe(struct platform_device *pdev) ...@@ -633,19 +633,25 @@ static int au1000_ac97_probe(struct platform_device *pdev)
au1000->stream[PLAYBACK] = kmalloc(sizeof(struct audio_stream), au1000->stream[PLAYBACK] = kmalloc(sizeof(struct audio_stream),
GFP_KERNEL); GFP_KERNEL);
if (!au1000->stream[PLAYBACK]) if (!au1000->stream[PLAYBACK]) {
err = -ENOMEM;
goto out; goto out;
}
au1000->stream[PLAYBACK]->dma = -1; au1000->stream[PLAYBACK]->dma = -1;
au1000->stream[CAPTURE] = kmalloc(sizeof(struct audio_stream), au1000->stream[CAPTURE] = kmalloc(sizeof(struct audio_stream),
GFP_KERNEL); GFP_KERNEL);
if (!au1000->stream[CAPTURE]) if (!au1000->stream[CAPTURE]) {
err = -ENOMEM;
goto out; goto out;
}
au1000->stream[CAPTURE]->dma = -1; au1000->stream[CAPTURE]->dma = -1;
r = platform_get_resource(pdev, IORESOURCE_MEM, 0); r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!r) if (!r) {
err = -ENODEV;
goto out; goto out;
}
err = -EBUSY; err = -EBUSY;
au1000->ac97_res_port = request_mem_region(r->start, resource_size(r), au1000->ac97_res_port = request_mem_region(r->start, resource_size(r),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment