Skip to content

Commit 1e235d0

Browse files
Gax-cgregkh
authored andcommitted
ASoC: qcom: Fix NULL Dereference in asoc_qcom_lpass_cpu_platform_probe()
commit 49da146 upstream. 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: b5022a3 ("ASoC: qcom: lpass: Use regmap_field for i2sctl and dmactl registers") Cc: stable@vger.kernel.org Signed-off-by: Zichen Xie <zichenxie0106@gmail.com> Link: https://patch.msgid.link/20241006205737.8829-1-zichenxie0106@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent fc34d36 commit 1e235d0

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

sound/soc/qcom/lpass-cpu.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,6 +1242,8 @@ int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev)
12421242
/* Allocation for i2sctl regmap fields */
12431243
drvdata->i2sctl = devm_kzalloc(&pdev->dev, sizeof(struct lpaif_i2sctl),
12441244
GFP_KERNEL);
1245+
if (!drvdata->i2sctl)
1246+
return -ENOMEM;
12451247

12461248
/* Initialize bitfields for dai I2SCTL register */
12471249
ret = lpass_cpu_init_i2sctl_bitfields(dev, drvdata->i2sctl,

0 commit comments

Comments
 (0)