Эх сурвалжийг харах

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 <[email protected]>
Yuan Zhao 5 жил өмнө
parent
commit
c1c2e1ca63
1 өөрчлөгдсөн 3 нэмэгдсэн , 3 устгасан
  1. 3 3
      msm/dp/dp_mst_drm.c

+ 3 - 3
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;
 	}