mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rohit Kumar <rohitkr@codeaurora.org>
To: Colin King <colin.king@canonical.com>,
	Patrick Lai <plai@codeaurora.org>,
	Banajit Goswami <bgoswami@codeaurora.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>, Ajit Pandey <ajitp@codeaurora.org>,
	Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
	alsa-devel@alsa-project.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next] ASoC: qcom: add missing out of memory check on drvdata->clks allocation
Date: Thu, 20 Aug 2020 09:25:33 +0530	[thread overview]
Message-ID: <82bb39d1-c3a9-a8d1-9d96-f4d6d6b0f042@codeaurora.org> (raw)
In-Reply-To: <20200819160103.164893-1-colin.king@canonical.com>


On 8/19/2020 9:31 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Currently drvdata->clks is not being checked for an allocation failure,
> leading to potential null pointer dereferencing. Fix this by adding a
> check and returning -ENOMEM if an error occurred.
>
> Addresses-Coverity: ("Dereference null return value")
> Fixes: 1220f6a76e77 ("ASoC: qcom: Add common array to initialize soc based core clocks")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---

Thanks for the fix.

Reviewed-by: Rohit kumar <rohitkr@codeaurora.org>

>   sound/soc/qcom/lpass-apq8016.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/sound/soc/qcom/lpass-apq8016.c b/sound/soc/qcom/lpass-apq8016.c
> index dd9e3dd014f6..5c8ae225cd5d 100644
> --- a/sound/soc/qcom/lpass-apq8016.c
> +++ b/sound/soc/qcom/lpass-apq8016.c
> @@ -168,6 +168,8 @@ static int apq8016_lpass_init(struct platform_device *pdev)
>   
>   	drvdata->clks = devm_kcalloc(dev, variant->num_clks,
>   				     sizeof(*drvdata->clks), GFP_KERNEL);
> +	if (!drvdata->clks)
> +		return -ENOMEM;
>   	drvdata->num_clks = variant->num_clks;
>   
>   	for (i = 0; i < drvdata->num_clks; i++)

-- 
Qualcomm INDIA, on behalf of Qualcomm Innovation Center, Inc.is a member
of the Code Aurora Forum, hosted by the Linux Foundation.


  reply	other threads:[~2020-08-20  3:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-19 16:01 Colin King
2020-08-20  3:55 ` Rohit Kumar [this message]
2020-08-20 21:48 ` 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=82bb39d1-c3a9-a8d1-9d96-f4d6d6b0f042@codeaurora.org \
    --to=rohitkr@codeaurora.org \
    --cc=ajitp@codeaurora.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=bgoswami@codeaurora.org \
    --cc=broonie@kernel.org \
    --cc=colin.king@canonical.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=plai@codeaurora.org \
    --cc=srinivas.kandagatla@linaro.org \
    --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®