From: Mark Brown <broonie@kernel.org>
To: Defang Bo <bodefang@126.com>
Cc: lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com,
Vishnuvardhanrao.Ravulapati@amd.com, akshu.agrawal@amd.com,
alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ASoC: amd: move the call to devm_kzalloc below platform_get_resource()
Date: Mon, 19 Oct 2020 14:43:18 +0100 [thread overview]
Message-ID: <20201019134318.GB4904@sirena.org.uk> (raw)
In-Reply-To: <1603110689-5015-1-git-send-email-bodefang@126.com>
[-- Attachment #1: Type: text/plain, Size: 713 bytes --]
On Mon, Oct 19, 2020 at 08:31:29PM +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 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); fails,so move the call to devm_kzalloc() below the mentioned code.
Please keep your commit message wrapped at below 80 columns.
> - if (!adata)
> - return -ENOMEM;
> -
> res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> if (!res) {
> dev_err(&pdev->dev, "IORESOURCE_MEM FAILED\n");
> return -ENOMEM;
> }
> + adata = devm_kzalloc(&pdev->dev, sizeof(struct i2s_dev_data), GFP_KERNEL);
This is missing a blank line between the two code blocks.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 484 bytes --]
prev parent reply other threads:[~2020-10-19 13:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-19 12:31 Defang Bo
2020-10-19 13:43 ` Mark Brown [this message]
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=20201019134318.GB4904@sirena.org.uk \
--to=broonie@kernel.org \
--cc=Vishnuvardhanrao.Ravulapati@amd.com \
--cc=akshu.agrawal@amd.com \
--cc=alsa-devel@alsa-project.org \
--cc=bodefang@126.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.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
all inboxes | Powered by JetHome®