Skip to contentSkip to conversation

ASoC: qcom: Fix NULL Dereference in asoc_qcom_lpass_cpu_platform_probe()

PATCH In review Gax-c 4 participants 10 messages Oct 2, 2024 – Oct 7, 2024

Subsystems (5)
lore
Share & tools
lore

Gax-c

author
#0 lore raw

PATCH 1/1 ASoC: qcom: Fix NULL 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 without addtional check.
Add a NULL check for the returned pointer.

Fixes b5022a36d28f ("ASoC: qcom: lpass: Use regmap_field for i2sctl and dmactl registers")
---
 sound/soc/qcom/lpass-cpu.c | 2 ++
 1 file changed, 2 insertions(+)
sound/soc/qcom/lpass-cpu.c +2 -0
index 5a47f661e0c6..242bc16da36d 100644
@@ -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,
Signature · 1 line
2.25.1
maintainer
#1 lore raw
Quoted 8 lines · Gax-c

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")

Your "From:" line does not match your signed-off-by :(

author
#2 lore raw

PATCH 1/1 ASoC: qcom: Fix NULL Dereference in asoc_qcom_lpass_cpu_platform_probe()

From: Zichen Xie <[email protected]>

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")
---
 sound/soc/qcom/lpass-cpu.c | 2 ++
 1 file changed, 2 insertions(+)
sound/soc/qcom/lpass-cpu.c +2 -0
index 5a47f661e0c6..242bc16da36d 100644
@@ -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,
Signature · 1 line
2.25.1
#3 lore raw
Quoted 1 line

A devm_kzalloc() in asoc_qcom_lpass_cpu_platform_probe() could

call?

Quoted 2 lines

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?

…

Quoted 2 lines
---
 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

Regards,
Markus

#4 lore raw
Quoted 16 lines · Markus Elfring
Quoted 1 line

A devm_kzalloc() in asoc_qcom_lpass_cpu_platform_probe() could

call?

Quoted 2 lines

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?

…

Quoted 8 lines
Quoted 2 lines
---
 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

Regards,
Markus

Hi,

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.

thanks,

greg k-h's patch email bot

#5 lore raw
Quoted 21 lines
Quoted 21 lines
Quoted 1 line

A devm_kzalloc() in asoc_qcom_lpass_cpu_platform_probe() could

call?

Quoted 2 lines

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?

…

Quoted 2 lines
---
 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

…

Quoted 8 lines

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.

Quoted 6 lines

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

#6 lore raw
Quoted 30 lines · Markus Elfring
Quoted 21 lines
Quoted 21 lines
Quoted 1 line

A devm_kzalloc() in asoc_qcom_lpass_cpu_platform_probe() could

call?

Quoted 2 lines

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?

…

Quoted 2 lines
---
 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

…

Quoted 8 lines

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.

Quoted 7 lines
Quoted 6 lines

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?

No.

Quoted 1 line

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

No.

#7 lore raw
Quoted 23 lines
Quoted 23 lines
Quoted 21 lines
Quoted 21 lines
Quoted 1 line

A devm_kzalloc() in asoc_qcom_lpass_cpu_platform_probe() could

call?

Quoted 2 lines

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?

…

Quoted 2 lines
---
 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

…

Quoted 1 line

This is the semi-friendly patch-bot of Greg Kroah-Hartman.

…

Quoted 3 lines
Quoted 1 line

* Do you care for any spell checking?

No.

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

Quoted 3 lines
Quoted 1 line

* 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

#9 lore raw
In reply to Gax-c
Quoted 10 lines · Gax-c

From: Zichen Xie <[email protected]>

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")

I think Fixes / Cc / Signed-off-by is more logical.

Quoted 4 lines
---
 sound/soc/qcom/lpass-cpu.c | 2 ++
 1 file changed, 2 insertions(+)

This is version two of your patch (even though the patch contents didn't change). Please tag your patches accordingly, provide a changelog and don't send next iteration as a reply to the existing thread (it might get lost or mishandled). Please send a proper v3 of your patch.

Signature · 2 lines
With best wishes
Dmitry