Skip to content

Commit 49da146

Browse files
Gax-cbroonie
authored andcommitted
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: b5022a3 ("ASoC: qcom: lpass: Use regmap_field for i2sctl and dmactl registers") Cc: [email protected] Signed-off-by: Zichen Xie <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 8cf0b93 commit 49da146

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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)