Commit 8d937040 authored by Zichen Xie's avatar Zichen Xie Committed by Lin Ruifeng
Browse files

ASoC: qcom: Fix NULL Dereference in asoc_qcom_lpass_cpu_platform_probe()

stable inclusion
from stable-v5.15.170
commit a8e691fe1894c8bdf815a6171ee22ae7da8b18aa
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IB2BX0
CVE: CVE-2024-50103

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=a8e691fe1894c8bdf815a6171ee22ae7da8b18aa



--------------------------------

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: b5022a36 ("ASoC: qcom: lpass: Use regmap_field for i2sctl and dmactl registers")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarZichen Xie <zichenxie0106@gmail.com>
Link: https://patch.msgid.link/20241006205737.8829-1-zichenxie0106@gmail.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarLin Ruifeng <linruifeng4@huawei.com>
parent 87fa1e0e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -946,6 +946,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,