* 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; 3+ 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] 3+ messages in thread
* Re: [PATCH] Fix possible NULL Pointer Dereference in 'asoc_qcom_lpass_cpu_platform_probe' 2024-09-30 16:33 ` [PATCH] Fix possible NULL Pointer Dereference in 'asoc_qcom_lpass_cpu_platform_probe' Markus Elfring @ 2024-09-30 18:16 ` Mark Brown 2024-10-01 5:30 ` Markus Elfring 0 siblings, 1 reply; 3+ 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] 3+ messages in thread
* Re: Fix possible NULL Pointer Dereference in 'asoc_qcom_lpass_cpu_platform_probe' 2024-09-30 18:16 ` Mark Brown @ 2024-10-01 5:30 ` Markus Elfring 0 siblings, 0 replies; 3+ messages in thread From: Markus Elfring @ 2024-10-01 5:30 UTC (permalink / raw) To: Mark Brown, Zichen Xie, alsa-devel, linux-sound, linux-arm-msm, Jaroslav Kysela, Liam Girdwood, Rohit kumar, Srinivas Kandagatla, Takashi Iwai Cc: kernel-janitors, LKML, Zijie Zhao, Chenyuan Yang >> 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. 30 non-merge commits were published with related subjects so far. Can you get a more constructive view from parts of public software development history? https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?h=v6.12-rc1&qt=grep&q=Return+directly+after+a+failed Regards, Markus ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-10-01 5:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20240930011521.26283-1-zichenxie0106@gmail.com>
2024-09-30 16:33 ` [PATCH] Fix possible NULL Pointer Dereference in 'asoc_qcom_lpass_cpu_platform_probe' Markus Elfring
2024-09-30 18:16 ` Mark Brown
2024-10-01 5:30 ` Markus Elfring
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®