diff --git a/sound/soc/rockchip/rockchip_hdmi.c b/sound/soc/rockchip/rockchip_hdmi.c index f7d721272267..5ce19953f855 100644 --- a/sound/soc/rockchip/rockchip_hdmi.c +++ b/sound/soc/rockchip/rockchip_hdmi.c @@ -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;