If drm_connector_init fails, intel_connector_free will be called to take care of proper free. So it is necessary to drop the refcount of port before intel_connector_free.
Unified · Split
| @@ -839,6 +839,7 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo · 838 unmodified lines | |||
| 839 | ret = drm_connector_init(dev, connector, &intel_dp_mst_connector_funcs, | 839 | ret = drm_connector_init(dev, connector, &intel_dp_mst_connector_funcs, |
| 840 | DRM_MODE_CONNECTOR_DisplayPort); | 840 | DRM_MODE_CONNECTOR_DisplayPort); |
| 841 | if (ret) { | 841 | if (ret) { |
| 842 | drm_dp_mst_put_port_malloc(port); | ||
| 842 | intel_connector_free(intel_connector); | 843 | intel_connector_free(intel_connector); |
| 843 | return NULL; | 844 | return NULL; |
| 844 | } | 845 | } |