From: Defang Bo <bodefang@126.com>
To: perex@perex.cz
Cc: tiwai@suse.com, lgirdwood@gmail.com,
Vishnuvardhanrao.Ravulapati@amd.com, akshu.agrawal@amd.com,
weiyongjun1@huawei.com, alsa-devel@alsa-project.org,
linux-kernel@vger.kernel.org, Defang Bo <bodefang@126.com>
Subject: [PATCH v2] ASoC: amd: move the call to devm_kzalloc below platform_get_resource()
Date: Wed, 21 Oct 2020 15:03:02 +0800 [thread overview]
Message-ID: <1603263782-8711-1-git-send-email-bodefang@126.com> (raw)
In-Reply-To: <broonie@kernel.org>
Just as the commit <4cb79ef9c6c4>("ASoC: amd: Fix potential NULL pointer dereference"),it makes no sense to allocate any resources if platform_get_resource fails,so move the call to devm_kzalloc() below the mentioned code.
Signed-off-by: Defang Bo <bodefang@126.com>
---
sound/soc/amd/raven/acp3x-i2s.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/soc/amd/raven/acp3x-i2s.c b/sound/soc/amd/raven/acp3x-i2s.c
index c9c69eb..04ec603 100644
--- a/sound/soc/amd/raven/acp3x-i2s.c
+++ b/sound/soc/amd/raven/acp3x-i2s.c
@@ -307,9 +307,11 @@ static int acp3x_dai_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "IORESOURCE_MEM FAILED\n");
return -ENOMEM;
}
+
adata = devm_kzalloc(&pdev->dev, sizeof(struct i2s_dev_data), GFP_KERNEL);
if (!adata)
return -ENOMEM;
+
adata->acp3x_base = devm_ioremap(&pdev->dev, res->start,
resource_size(res));
if (!adata->acp3x_base)
--
1.9.1
next prev parent reply other threads:[~2020-10-21 7:07 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <broonie@kernel.org>
2020-05-25 3:40 ` [PATCH v5 0/8] Enable ili9341 and l3gd20 on stm32f429-disco dillon.minfei
2020-05-25 3:40 ` [PATCH v5 1/8] ARM: dts: stm32: Add dma config for spi5 dillon.minfei
2020-05-25 3:40 ` [PATCH v5 2/8] ARM: dts: stm32: Add pin map for ltdc & spi5 on stm32f429-disco board dillon.minfei
2020-05-25 3:40 ` [PATCH v5 3/8] ARM: dts: stm32: enable ltdc binding with ili9341, gyro l3gd20 on stm32429-disco board dillon.minfei
2020-05-25 3:40 ` [PATCH v5 4/8] dt-bindings: display: panel: Add ilitek ili9341 panel bindings dillon.minfei
2020-05-25 3:40 ` [PATCH v5 5/8] clk: stm32: Fix stm32f429's ltdc driver hang in set clock rate, fix duplicated ltdc clock register to 'clk_core' case ltdc's clock turn off by clk_disable_unused() dillon.minfei
2020-05-25 3:41 ` [PATCH v5 6/8] drm/panel: Add ilitek ili9341 panel driver dillon.minfei
2020-05-25 3:41 ` [PATCH v5 7/8] spi: stm32: Add 'SPI_SIMPLEX_RX', 'SPI_3WIRE_RX' support for stm32f4 dillon.minfei
2020-05-25 3:41 ` [PATCH v5 8/8] spi: flags 'SPI_CONTROLLER_MUST_RX' and 'SPI_CONTROLLER_MUST_TX' can't be coexit with 'SPI_3WIRE' mode dillon.minfei
2020-07-21 9:19 ` [PATCH v5 0/8] Enable ili9341 and l3gd20 on stm32f429-disco Alexandre Torgue
2020-07-21 10:39 ` dillon min
2020-07-21 11:54 ` Alexandre Torgue
2020-07-21 12:55 ` dillon min
2020-07-21 12:58 ` Alexandre Torgue
2020-10-21 7:03 ` Defang Bo [this message]
2020-10-21 7:04 [PATCH v2] ASoC: amd: move the call to devm_kzalloc below platform_get_resource() Defang Bo
2020-10-21 9:41 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1603263782-8711-1-git-send-email-bodefang@126.com \
--to=bodefang@126.com \
--cc=Vishnuvardhanrao.Ravulapati@amd.com \
--cc=akshu.agrawal@amd.com \
--cc=alsa-devel@alsa-project.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
--cc=weiyongjun1@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox