[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241001210209.2554-1-zichenxie0106@gmail.com>
Date: Tue, 1 Oct 2024 16:02:10 -0500
From: Gax-c <zichenxie0106@...il.com>
To: srinivas.kandagatla@...aro.org,
lgirdwood@...il.com,
broonie@...nel.org,
perex@...ex.cz,
tiwai@...e.com,
rohitkr@...eaurora.org
Cc: alsa-devel@...a-project.org,
linux-arm-msm@...r.kernel.org,
linux-sound@...r.kernel.org,
linux-kernel@...r.kernel.org,
chenyuan0y@...il.com,
zzjas98@...il.com,
Gax-c <zichenxie0106@...il.com>,
stable@...r.kernel.org
Subject: [PATCH] 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")
Signed-off-by: Zichen Xie <zichenxie0106@...il.com>
Cc: stable@...r.kernel.org
Reported-by: Zichen Xie <zichenxie0106@...il.com>
---
sound/soc/qcom/lpass-cpu.c | 2 ++
1 file changed, 2 insertions(+)
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,
--
2.25.1
Powered by blists - more mailing lists