diff --git a/sound/soc/rockchip/rockchip_hdmi.c b/sound/soc/rockchip/rockchip_hdmi.c index 69ff54cc3bdf..3315407c8e7e 100644 --- a/sound/soc/rockchip/rockchip_hdmi.c +++ b/sound/soc/rockchip/rockchip_hdmi.c @@ -213,6 +213,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;