History

drm/i915: fix a possible refcount leak in intel_dp_add_mst_connector()

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.

Hangyu Hua committed 4 years ago

Commit 046cd8a1 parent 32346491 file · +1 −0Browse files

Unified · Split

drivers/gpu/drm/i915/display/intel_dp_mst.c+1−0
@@ -839,6 +839,7 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo · 838 unmodified lines
839839 ret = drm_connector_init(dev, connector, &intel_dp_mst_connector_funcs,
840840 DRM_MODE_CONNECTOR_DisplayPort);
841841 if (ret) {
842+ drm_dp_mst_put_port_malloc(port);
842843 intel_connector_free(intel_connector);
843844 return NULL;
844845 }