[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <30cfc980-3b38-4e98-a753-b149746cf93c@web.de>
Date: Mon, 30 Sep 2024 18:33:49 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: Zichen Xie <zichenxie0106@...il.com>, alsa-devel@...a-project.org,
linux-sound@...r.kernel.org, linux-arm-msm@...r.kernel.org,
Jaroslav Kysela <perex@...ex.cz>, Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>, Rohit kumar <quic_rohkumar@...cinc.com>,
Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
Takashi Iwai <tiwai@...e.com>
Cc: LKML <linux-kernel@...r.kernel.org>, Zijie Zhao <zzjas98@...il.com>,
Chenyuan Yang <chenyuan0y@...il.com>
Subject: Re: [PATCH] Fix possible NULL Pointer Dereference in
'asoc_qcom_lpass_cpu_platform_probe'
> A 'devm_kzalloc' in 'asoc_qcom_lpass_cpu_platform_probe' could possibly return NULL pointer.
> NULL Pointer Dereference may be triggerred in 'asoc_qcom_lpass_cpu_platform_probe' without addtional check.
> Add a null check for the returned pointer.
How do you think about a wording variant like the following?
The result from a call of the function “devm_kzalloc” was passed to
a subsequent function call without checking for a null pointer before
(according to a memory allocation failure).
Thus return directly after a failed devm_kzalloc() call.
…
> Signed-off-by: Zichen Xie <zichenxie0106@...il.com>
> Reported-by: Zichen Xie <zichenxie0106@...il.com>
…
How good does such a tag combination fit together for the same person?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.12-rc1#n525
Can a subject like “[PATCH] ASoC: qcom: lpass-cpu: Return directly after a failed devm_kzalloc() call
in asoc_qcom_lpass_cpu_platform_probe()” be more appropriate?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.12-rc1#n613
…
> +++ b/sound/soc/qcom/lpass-cpu.c
> @@ -1243,6 +1243,9 @@ int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev)
> drvdata->i2sctl = devm_kzalloc(&pdev->dev, sizeof(struct lpaif_i2sctl),
> GFP_KERNEL);
>
> + if (!drvdata->i2sctl)
> + return -ENOMEM;
…
I suggest to omit a blank line here.
By the way:
Would you become interested to omit the label “err” from this function implementation finally?
Regards,
Markus
Powered by blists - more mailing lists