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. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> --- sound/soc/txx9/txx9aclc-ac97.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sound/soc/txx9/txx9aclc-ac97.c b/sound/soc/txx9/txx9aclc-ac97.c index e0305a1..9edd68d 100644 --- a/sound/soc/txx9/txx9aclc-ac97.c +++ b/sound/soc/txx9/txx9aclc-ac97.c @@ -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) && -- 1.8.3.2
[-- Attachment #1.1: Type: text/plain, Size: 302 bytes --] On Sat, Feb 15, 2014 at 11:28:29PM +0400, Alexander Shiyan wrote: > 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. Applied, thanks. [-- Attachment #1.2: Digital signature --] [-- Type: application/pgp-signature, Size: 836 bytes --] [-- Attachment #2: Type: text/plain, Size: 0 bytes --]
[-- Attachment #1.1: Type: text/plain, Size: 378 bytes --] On Sat, Feb 15, 2014 at 11:28:29PM +0400, Alexander Shiyan wrote: > 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. I don't know where you got that hash from by the way, that commit isn't present in mainline? [-- Attachment #1.2: Digital signature --] [-- Type: application/pgp-signature, Size: 836 bytes --] [-- Attachment #2: Type: text/plain, Size: 0 bytes --]
Воскресенье, 16 февраля 2014, 8:38 +08:00 от Mark Brown <broonie@kernel.org>: > On Sat, Feb 15, 2014 at 11:28:29PM +0400, Alexander Shiyan wrote: > > 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. > > I don't know where you got that hash from by the way, that commit isn't > present in mainline? https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/sound/soc/txx9/txx9aclc-ac97.c?id=3bed3344c82623f6a37f3032e307d9af5b2d7519 --- _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
[-- Attachment #1.1: Type: text/plain, Size: 656 bytes --] On Sun, Feb 16, 2014 at 06:55:53AM +0400, Alexander Shiyan wrote: > Воскресенье, 16 февраля 2014, 8:38 +08:00 от Mark Brown <broonie@kernel.org>: > > On Sat, Feb 15, 2014 at 11:28:29PM +0400, Alexander Shiyan wrote: > > > This patch fixes a crash caused by commit af5b2d7519 > > I don't know where you got that hash from by the way, that commit isn't > > present in mainline? > https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/sound/soc/txx9/txx9aclc-ac97.c?id=3bed3344c82623f6a37f3032e307d9af5b2d7519 A shortened commit ID is the *start* of the ID, not the end. Try running 'git show af5b2d7519'. [-- Attachment #1.2: Digital signature --] [-- Type: application/pgp-signature, Size: 836 bytes --] [-- Attachment #2: Type: text/plain, Size: 0 bytes --]