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 <yzhao@codeaurora.org>
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

parent
4ebc0e1f34
commit
c1c2e1ca63
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user