ASoC: rockchip: multicodecs: Fix potential NULL point reference

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I43399292c8f242e98139cb8e285f5bc732889894
This commit is contained in:
Sugar Zhang 2023-03-03 10:43:46 +08:00 committed by Tao Huang
parent b4652bb42b
commit 6026cf7136
1 changed files with 3 additions and 0 deletions

View File

@ -657,6 +657,9 @@ static int rk_multicodecs_probe(struct platform_device *pdev)
codecs = devm_kcalloc(&pdev->dev, idx,
sizeof(*codecs), GFP_KERNEL);
if (!codecs)
return -ENOMEM;
link->codecs = codecs;
link->num_codecs = idx;
idx = 0;