alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] ASoC: amd: move the call to devm_kzalloc below platform_get_resource()
@ 2020-10-21  7:04 Defang Bo
  2020-10-21  9:41 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Defang Bo @ 2020-10-21  7:04 UTC (permalink / raw)
  To: broonie, perex
  Cc: alsa-devel, lgirdwood, linux-kernel, tiwai, Defang Bo,
	akshu.agrawal, weiyongjun1, Vishnuvardhanrao.Ravulapati

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] ASoC: amd: move the call to devm_kzalloc below platform_get_resource()
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2020-10-21  9:41 UTC (permalink / raw)
  To: Defang Bo
  Cc: alsa-devel, linux-kernel, tiwai, lgirdwood, akshu.agrawal,
	weiyongjun1, Vishnuvardhanrao.Ravulapati

[-- Attachment #1: Type: text/plain, Size: 1082 bytes --]

On Wed, Oct 21, 2020 at 03:04:27PM +0800, Defang Bo wrote:

> 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.

As I said on my previous mail:

| Please keep your commit message wrapped at below 80 columns.

Please don't ignore review comments, people are generally making them
for a reason and are likely to have the same concerns if issues remain
unaddressed.  Having to repeat the same comments can get repetitive and
make people question the value of time spent reviewing.  If you disagree
with the review comments that's fine but you need to reply and discuss
your concerns so that the reviewer can understand your decisions.

>  	}
> +
>  	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,

This appears to add new whitespace, it doesn't seem to do what the
commit log says?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-21 13:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).