[PATCH] drm/imx: Add error handling in dw_hdmi_imx_probe()

liuhaoran liuhaoran14 at 163.com
Sun Sep 24 07:30:01 UTC 2023


This patch adds error-handling for the of_match_node()
inside the dw_hdmi_imx_probe().

Signed-off-by: liuhaoran <liuhaoran14 at 163.com>
---
 drivers/gpu/drm/imx/ipuv3/dw_hdmi-imx.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/imx/ipuv3/dw_hdmi-imx.c b/drivers/gpu/drm/imx/ipuv3/dw_hdmi-imx.c
index a2277a0d6d06..3b25f018b2a6 100644
--- a/drivers/gpu/drm/imx/ipuv3/dw_hdmi-imx.c
+++ b/drivers/gpu/drm/imx/ipuv3/dw_hdmi-imx.c
@@ -224,6 +224,9 @@ static int dw_hdmi_imx_probe(struct platform_device *pdev)
 	struct imx_hdmi *hdmi;
 	int ret;
 
+	if (!match)
+		return -ENODEV;
+
 	hdmi = devm_kzalloc(&pdev->dev, sizeof(*hdmi), GFP_KERNEL);
 	if (!hdmi)
 		return -ENOMEM;
-- 
2.17.1



More information about the dri-devel mailing list