* [PATCH -next] ASoC: mid-x86: add missing iounmap() to probe error and remove
@ 2013-05-13 9:00 Wei Yongjun
2013-05-13 13:45 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2013-05-13 9:00 UTC (permalink / raw)
To: lgirdwood, broonie, perex, tiwai, wfp5p, vinod.koul, ramesh.babu,
namartax.kohli
Cc: yongjun_wei, alsa-devel, linux-kernel
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Add the missing iounmap() before return from snd_mfld_mc_probe()
in the error handling case and to snd_mfld_mc_remove().
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
sound/soc/mid-x86/mfld_machine.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/sound/soc/mid-x86/mfld_machine.c b/sound/soc/mid-x86/mfld_machine.c
index 78d5825..8206e84 100644
--- a/sound/soc/mid-x86/mfld_machine.c
+++ b/sound/soc/mid-x86/mfld_machine.c
@@ -397,7 +397,7 @@ static int snd_mfld_mc_probe(struct platform_device *pdev)
IRQF_SHARED, pdev->dev.driver->name, mc_drv_ctx);
if (ret_val) {
pr_err("cannot register IRQ\n");
- goto unalloc;
+ goto unmap;
}
/* register the soc card */
snd_soc_card_mfld.dev = &pdev->dev;
@@ -412,6 +412,8 @@ static int snd_mfld_mc_probe(struct platform_device *pdev)
freeirq:
free_irq(irq, mc_drv_ctx);
+unmap:
+ iounmap(mc_drv_ctx->int_base);
unalloc:
kfree(mc_drv_ctx);
return ret_val;
@@ -424,6 +426,7 @@ static int snd_mfld_mc_remove(struct platform_device *pdev)
pr_debug("snd_mfld_mc_remove called\n");
free_irq(platform_get_irq(pdev, 0), mc_drv_ctx);
snd_soc_unregister_card(&snd_soc_card_mfld);
+ iounmap(mc_drv_ctx->int_base);
kfree(mc_drv_ctx);
return 0;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH -next] ASoC: mid-x86: add missing iounmap() to probe error and remove
2013-05-13 9:00 [PATCH -next] ASoC: mid-x86: add missing iounmap() to probe error and remove Wei Yongjun
@ 2013-05-13 13:45 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2013-05-13 13:45 UTC (permalink / raw)
To: Wei Yongjun
Cc: lgirdwood, perex, tiwai, wfp5p, vinod.koul, ramesh.babu,
namartax.kohli, yongjun_wei, alsa-devel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 372 bytes --]
On Mon, May 13, 2013 at 05:00:44PM +0800, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> Add the missing iounmap() before return from snd_mfld_mc_probe()
> in the error handling case and to snd_mfld_mc_remove().
A better approach to this sort of issue is to convert to devm_,
eliminating the possibility of such errors in the future.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-05-13 13:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-13 9:00 [PATCH -next] ASoC: mid-x86: add missing iounmap() to probe error and remove Wei Yongjun
2013-05-13 13:45 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®