Skip to contentSkip to conversation

ASoC: qcom: Fix NULL Dereference in asoc_qcom_lpass_cpu_platform_probe()

PATCH In review Gax-c 3 participants 6 messages Oct 6, 2024 – Oct 7, 2024

Subsystems (5)
lore
Share & tools
lore

Gax-c

author
#0 lore raw

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

---
v2: Fix "From" tag.
v3: Format tags to Fixes/Cc/Signed-off-by.

---
 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
#1 lore raw
Quoted 1 line

A devm_kzalloc() in asoc_qcom_lpass_cpu_platform_probe() could

call?

Quoted 1 line

possibly return NULL pointer. NULL Pointer Dereference may be

Can the term “null pointer dereference” be applied for the final commit message (including the summary phrase)?

Quoted 1 line

triggerred without addtional check.

triggered? additional?

Regards,
Markus

maintainer
#2 lore raw
Quoted 7 lines · Markus Elfring
Quoted 1 line

A devm_kzalloc() in asoc_qcom_lpass_cpu_platform_probe() could

call?

Quoted 1 line

possibly return NULL pointer. NULL Pointer Dereference may be

Quoted 7 lines

Can the term “null pointer dereference” be applied for the final commit message (including the summary phrase)?

Quoted 1 line

triggerred without addtional check.

triggered? additional?

Feel free to ignore Markus, he has a long history of sending unhelpful review comments and continues to ignore repeated requests to stop.

#3 lore raw
In reply to Gax-c

…

Quoted 4 lines

---
v2: Fix "From" tag.
v3: Format tags to Fixes/Cc/Signed-off-by.
---

…

* How do you think about to reconsider the version numbers a bit more?

* Would you like to mention the repeated adjustment of the patch subject?

* Can a duplicate marker line be replaced by a blank line?

See also:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.12-rc2#n231

Is the email address “[email protected]” still relevant here?

Regards,
Markus

maintainer
#4 lore raw
Quoted 7 lines · Markus Elfring

* How do you think about to reconsider the version numbers a bit more?

* Would you like to mention the repeated adjustment of the patch subject?

* Can a duplicate marker line be replaced by a blank line?

Feel free to ignore Markus, he has a long history of sending unhelpful review comments and continues to ignore repeated requests to stop.

maintainer
#5 lore raw
In reply to Gax-c
Quoted 6 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.

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

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

      commit: 49da1463c9e3d2082276c3e0e2a8b65a88711cd2

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark