diff options
| author | Zichen Xie <zichenxie0106@gmail.com> | 2024-10-06 15:57:37 -0500 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-11-01 01:58:34 +0100 |
| commit | 73cc3f905ca9aa95694eea3dfa1acadc90686368 (patch) | |
| tree | 5b57fd612e3a6137770de7980360df940b024a9b /sound/soc | |
| parent | 24f638125cc3d7b5870444238cded580c552ea31 (diff) | |
| download | linux-73cc3f905ca9aa95694eea3dfa1acadc90686368.tar.gz linux-73cc3f905ca9aa95694eea3dfa1acadc90686368.tar.bz2 linux-73cc3f905ca9aa95694eea3dfa1acadc90686368.zip | |
ASoC: qcom: Fix NULL Dereference in asoc_qcom_lpass_cpu_platform_probe()
commit 49da1463c9e3d2082276c3e0e2a8b65a88711cd2 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: b5022a36d28f ("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>
Diffstat (limited to 'sound/soc')
| -rw-r--r-- | sound/soc/qcom/lpass-cpu.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c index 73b42d9ee244..e587455dc40a 100644 --- a/sound/soc/qcom/lpass-cpu.c +++ b/sound/soc/qcom/lpass-cpu.c @@ -1246,6 +1246,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, |
