* Re: [PATCH] Fix possible NULL Pointer Dereference in 'asoc_qcom_lpass_cpu_platform_probe' [not found] <Zvrb+q28S/C4z2eH@hu-bjorande-lv.qualcomm.com> @ 2024-10-01 12:48 ` Markus Elfring 2024-10-01 12:58 ` Mark Brown 0 siblings, 1 reply; 4+ messages in thread From: Markus Elfring @ 2024-10-01 12:48 UTC (permalink / raw) To: Bjorn Andersson, alsa-devel, linux-sound, linux-arm-msm Cc: LKML, Chenyuan Yang, Jaroslav Kysela, Liam Girdwood, Mark Brown, Rohit kumar, Srinivas Kandagatla, Takashi Iwai, Zichen Xie, Zijie Zhao > > 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. > > Your description and patch looks good to me. Interesting “view” … > But please run git log on the changed file and add a prefix to your > subject to match other changes to this file, and please wrap your commit > message at 75 characters. * How does your initial information fit to this patch review advice? * Would you like to “tolerate” any typos (at the first glance)? Regards, Markus ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix possible NULL Pointer Dereference in 'asoc_qcom_lpass_cpu_platform_probe' 2024-10-01 12:48 ` [PATCH] Fix possible NULL Pointer Dereference in 'asoc_qcom_lpass_cpu_platform_probe' Markus Elfring @ 2024-10-01 12:58 ` Mark Brown 0 siblings, 0 replies; 4+ messages in thread From: Mark Brown @ 2024-10-01 12:58 UTC (permalink / raw) To: Markus Elfring Cc: Bjorn Andersson, alsa-devel, linux-sound, linux-arm-msm, LKML, Chenyuan Yang, Jaroslav Kysela, Liam Girdwood, Rohit kumar, Srinivas Kandagatla, Takashi Iwai, Zichen Xie, Zijie Zhao [-- Attachment #1: Type: text/plain, Size: 292 bytes --] On Tue, Oct 01, 2024 at 02:48:54PM +0200, Markus Elfring wrote: > > Your description and patch looks good to me. > Interesting “view” … Feel free to ignore Markus, he has a long history of sending unhelpful review comments and continues to ignore repeated requests to stop. [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 488 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <20240930011521.26283-1-zichenxie0106@gmail.com>]
* Re: [PATCH] Fix possible NULL Pointer Dereference in 'asoc_qcom_lpass_cpu_platform_probe' [not found] <20240930011521.26283-1-zichenxie0106@gmail.com> @ 2024-09-30 16:33 ` Markus Elfring 2024-09-30 18:16 ` Mark Brown 0 siblings, 1 reply; 4+ messages in thread From: Markus Elfring @ 2024-09-30 16:33 UTC (permalink / raw) To: Zichen Xie, alsa-devel, linux-sound, linux-arm-msm, Jaroslav Kysela, Liam Girdwood, Mark Brown, Rohit kumar, Srinivas Kandagatla, Takashi Iwai Cc: LKML, Zijie Zhao, Chenyuan Yang > 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@gmail.com> > Reported-by: Zichen Xie <zichenxie0106@gmail.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 ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix possible NULL Pointer Dereference in 'asoc_qcom_lpass_cpu_platform_probe' 2024-09-30 16:33 ` Markus Elfring @ 2024-09-30 18:16 ` Mark Brown 0 siblings, 0 replies; 4+ messages in thread From: Mark Brown @ 2024-09-30 18:16 UTC (permalink / raw) To: Markus Elfring Cc: Zichen Xie, alsa-devel, linux-sound, linux-arm-msm, Jaroslav Kysela, Liam Girdwood, Rohit kumar, Srinivas Kandagatla, Takashi Iwai, LKML, Zijie Zhao, Chenyuan Yang [-- Attachment #1: Type: text/plain, Size: 539 bytes --] On Mon, Sep 30, 2024 at 06:33:49PM +0200, Markus Elfring wrote: > 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. Feel free to ignore Markus, he has a long history of sending unhelpful review comments and continues to ignore repeated requests to stop. [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 488 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-10-01 12:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <Zvrb+q28S/C4z2eH@hu-bjorande-lv.qualcomm.com>
2024-10-01 12:48 ` [PATCH] Fix possible NULL Pointer Dereference in 'asoc_qcom_lpass_cpu_platform_probe' Markus Elfring
2024-10-01 12:58 ` Mark Brown
[not found] <20240930011521.26283-1-zichenxie0106@gmail.com>
2024-09-30 16:33 ` Markus Elfring
2024-09-30 18:16 ` Mark Brown
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®