ASoC: rockchip: hdmi: Fix potential NULL point reference

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I9d0c2adbdffc268d88bac31c1db31507fd82661d
This commit is contained in:
Sugar Zhang
2023-03-03 10:35:36 +08:00
committed by Tao Huang
parent 3a15fce889
commit b4652bb42b

View File

@@ -227,6 +227,9 @@ static int rk_hdmi_probe(struct platform_device *pdev)
codecs = devm_kcalloc(&pdev->dev, idx,
sizeof(*codecs), GFP_KERNEL);
if (!codecs)
return -ENOMEM;
rk_data->dai.codecs = codecs;
rk_data->dai.num_codecs = idx;
idx = 0;