diff mbox series

ASoC: qcom: Fix NULL Dereference in asoc_qcom_lpass_cpu_platform_probe()

Message ID 20241003152739.9650-1-zichenxie0106@gmail.com
State Superseded
Headers show
Series ASoC: qcom: Fix NULL Dereference in asoc_qcom_lpass_cpu_platform_probe() | expand

Commit Message

Gax-c Oct. 3, 2024, 3:27 p.m. UTC
From: Zichen Xie <zichenxie0106@gmail.com>

A devm_kzalloc() in asoc_qcom_lpass_cpu_platform_probe() could
possibly return NULL pointer. NULL Pointer Dereference may be
triggerred without addtional check.
Add a NULL check for the returned pointer.

Fixes: b5022a36d28f ("ASoC: qcom: lpass: Use regmap_field for i2sctl and dmactl registers")
Signed-off-by: Zichen Xie <zichenxie0106@gmail.com>
Cc: stable@vger.kernel.org
---
 sound/soc/qcom/lpass-cpu.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Markus Elfring Oct. 6, 2024, 8:56 a.m. UTC | #1
>>> A devm_kzalloc() in asoc_qcom_lpass_cpu_platform_probe() could
>>
>>                    call?
>>
>>
>>> possibly return NULL pointer. NULL Pointer Dereference may be
>>> triggerred without addtional check.
>> …
>>
>> * How do you think about to use the term “null pointer dereference”
>>   for the final commit message (including the summary phrase)?
>>
>> * Would you like to avoid any typos here?
>>
>>
>> …
>>> ---
>>>  sound/soc/qcom/lpass-cpu.c | 2 ++
>>
>> Did you overlook to add a version description behind the marker line?
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.12-rc1#n723> This is the semi-friendly patch-bot of Greg Kroah-Hartman.
>
> Markus, you seem to have sent a nonsensical or otherwise pointless
> review comment to a patch submission on a Linux kernel developer mailing
> list.  I strongly suggest that you not do this anymore.  Please do not
> bother developers who are actively working to produce patches and
> features with comments that, in the end, are a waste of time.
>
> Patch submitter, please ignore Markus's suggestion; you do not need to
> follow it at all.  The person/bot/AI that sent it is being ignored by
> almost all Linux kernel maintainers for having a persistent pattern of
> behavior of producing distracting and pointless commentary, and
> inability to adapt to feedback.  Please feel free to also ignore emails
> from them.
* Do you care for any spell checking?

* Do you find any related advice (from other automated responses) helpful?


Regards,
Markus
Markus Elfring Oct. 6, 2024, 11:12 a.m. UTC | #2
>>>>> A devm_kzalloc() in asoc_qcom_lpass_cpu_platform_probe() could
>>>>
>>>>                    call?
>>>>
>>>>
>>>>> possibly return NULL pointer. NULL Pointer Dereference may be
>>>>> triggerred without addtional check.
>>>> …
>>>>
>>>> * How do you think about to use the term “null pointer dereference”
>>>>   for the final commit message (including the summary phrase)?
>>>>
>>>> * Would you like to avoid any typos here?
>>>>
>>>>
>>>> …
>>>>> ---
>>>>>  sound/soc/qcom/lpass-cpu.c | 2 ++
>>>>
>>>> Did you overlook to add a version description behind the marker line?
>>>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.12-rc1#n723
>> …
>>> This is the semi-friendly patch-bot of Greg Kroah-Hartman.>> * Do you care for any spell checking?
>
> No.

I find such a feedback surprising.
Does it indicate any recurring communication difficulties?


>> * Do you find any related advice (from other automated responses) helpful?
>
> No.

I wonder how this answer fits to reminders for the Linux patch review process
(which were also automatically sent) according to your inbox filter rules.

Regards,
Markus
diff mbox series

Patch

diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c
index 5a47f661e0c6..242bc16da36d 100644
--- a/sound/soc/qcom/lpass-cpu.c
+++ b/sound/soc/qcom/lpass-cpu.c
@@ -1242,6 +1242,8 @@  int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev)
 	/* Allocation for i2sctl regmap fields */
 	drvdata->i2sctl = devm_kzalloc(&pdev->dev, sizeof(struct lpaif_i2sctl),
 					GFP_KERNEL);
+	if (!drvdata->i2sctl)
+		return -ENOMEM;
 
 	/* Initialize bitfields for dai I2SCTL register */
 	ret = lpass_cpu_init_i2sctl_bitfields(dev, drvdata->i2sctl,