瀏覽代碼

drm/exynos: check for null pointers in error handling

Smatch error from arm build: drivers/gpu/drm/exynos/
exynos_hdmi.c:2374 hdmi_probe() error: potential NULL
dereference 'hdata->hdmiphy_port'.

Added check for hdata->hdmiphy_port that it is not NULL.

Signed-off-by: Paul Taysom <taysom@chromium.org>
Signed-off-by: Rahul Sharma <Rahul.Sharma@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Paul Taysom 11 年之前
父節點
當前提交
b21a3bf441
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      drivers/gpu/drm/exynos/exynos_hdmi.c

+ 2 - 1
drivers/gpu/drm/exynos/exynos_hdmi.c

@@ -2174,7 +2174,8 @@ static int hdmi_probe(struct platform_device *pdev)
 	return exynos_drm_component_add(&pdev->dev, &hdmi_component_ops);
 	return exynos_drm_component_add(&pdev->dev, &hdmi_component_ops);
 
 
 err_hdmiphy:
 err_hdmiphy:
-	put_device(&hdata->hdmiphy_port->dev);
+	if (hdata->hdmiphy_port)
+		put_device(&hdata->hdmiphy_port->dev);
 err_ddc:
 err_ddc:
 	put_device(&hdata->ddc_adpt->dev);
 	put_device(&hdata->ddc_adpt->dev);
 	return ret;
 	return ret;