ASoC: txx9aclc_ac97: Fix kernel crash on probe
PATCH 1/1 ASoC: txx9aclc_ac97: Fix kernel crash on probe
This patch fixes a crash caused by commit af5b2d7519 (ASoC: txx9aclc_ac97: Convert to devm_ioremap_resource()). This is an attempt to assign "drvdata->base" while memory for "drvdata" is not already allocated.
--- sound/soc/txx9/txx9aclc-ac97.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
sound/soc/txx9/txx9aclc-ac97.c +5 -3
@@ -183,14 +183,16 @@ static int txx9aclc_ac97_dev_probe(struct platform_device *pdev) irq =platform_get_irq (pdev,0 );if (irq <0 )return irq; + + drvdata =devm_kzalloc (&pdev->dev,sizeof (*drvdata),GFP_KERNEL ); +if (!drvdata) +return -ENOMEM ; + r =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); drvdata->base =devm_ioremap_resource (&pdev->dev, r);if (IS_ERR (drvdata->base))return PTR_ERR (drvdata->base); - drvdata =devm_kzalloc (&pdev->dev,sizeof (*drvdata),GFP_KERNEL ); -if (!drvdata) -return -ENOMEM ;platform_set_drvdata (pdev, drvdata); drvdata->physbase = r->start; if (sizeof(drvdata->physbase) > sizeof(r->start) &&
Signature · 1 line
1.8.3.2
Quoted 4 lines · Alexander Shiyan
This patch fixes a crash caused by commit
af5b2d7519(ASoC:txx9aclc_ac97: Convert todevm_ioremap_resource()). This is an attempt to assign "drvdata->base" while memory for "drvdata" is not already allocated.
Applied, thanks.
Mark Brown
maintainerQuoted 4 lines · Alexander Shiyan
This patch fixes a crash caused by commit
af5b2d7519(ASoC:txx9aclc_ac97: Convert todevm_ioremap_resource()). This is an attempt to assign "drvdata->base" while memory for "drvdata" is not already allocated.
I don't know where you got that hash from by the way, that commit isn't present in mainline?
Воскресенье, 16 февраля 2014, 8:38 +08:00 от Mark Brown <[email protected]>:
Quoted 8 lines · Alexander Shiyan
Quoted 4 lines
This patch fixes a crash caused by commit
af5b2d7519(ASoC:txx9aclc_ac97: Convert todevm_ioremap_resource()). This is an attempt to assign "drvdata->base" while memory for "drvdata" is not already allocated.I don't know where you got that hash from by the way, that commit isn't present in mainline?
---
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Mark Brown
maintainerQuoted 8 lines · Alexander Shiyan
Воскресенье, 16 февраля 2014, 8:38 +08:00 от Mark Brown <[email protected]>:
Quoted 5 lines · Alexander Shiyan
Quoted 1 line
This patch fixes a crash caused by commit
af5b2d7519I don't know where you got that hash from by the way, that commit isn't present in mainline?
A shortened commit ID is the *start* of the ID, not the end. Try running 'git show af5b2d7519'.