From c1c2e1ca6305126c432ca26f5532a5daa7fedeb0 Mon Sep 17 00:00:00 2001 From: Yuan Zhao Date: Tue, 16 Jun 2020 17:51:49 +0800 Subject: [PATCH] disp: msm: dp: check ERR_PTR when creating a new connector sde_connector_init will return an ERR_PTR if connector creation failed, so need to use IS_ERR_OR_NULL to check the return value. Change-Id: I4fee5a624261898bbd079c54705e6eaebc71bac6 Signed-off-by: Yuan Zhao --- msm/dp/dp_mst_drm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/msm/dp/dp_mst_drm.c b/msm/dp/dp_mst_drm.c index 1cb8c0fff64c..922acfada8fc 100644 --- a/msm/dp/dp_mst_drm.c +++ b/msm/dp/dp_mst_drm.c @@ -1743,10 +1743,10 @@ dp_mst_add_connector(struct drm_dp_mst_topology_mgr *mgr, DRM_CONNECTOR_POLL_HPD, DRM_MODE_CONNECTOR_DisplayPort); - if (!connector) { + if (IS_ERR_OR_NULL(connector)) { DP_ERR("mst sde_connector_init failed\n"); drm_modeset_unlock_all(dev); - return connector; + return NULL; } rc = dp_display->mst_connector_install(dp_display, connector); @@ -2074,7 +2074,7 @@ dp_mst_drm_fixed_connector_init(struct dp_display *dp_display, DRM_CONNECTOR_POLL_HPD, DRM_MODE_CONNECTOR_DisplayPort); - if (!connector) { + if (IS_ERR_OR_NULL(connector)) { DP_ERR("mst sde_connector_init failed\n"); return NULL; }