drm/i915: fix a possible refcount leak in intel_dp_add_mst_connector()
authorjsg <jsg@openbsd.org>
Fri, 22 Jul 2022 06:00:45 +0000 (06:00 +0000)
committerjsg <jsg@openbsd.org>
Fri, 22 Jul 2022 06:00:45 +0000 (06:00 +0000)
From Hangyu Hua
505114dda5bbfd07f4ce9a2df5b7d8ef5f2a1218 in linux 5.15.y/5.15.56
85144df9ff4652816448369de76897c57cbb1b93 in mainline linux

sys/dev/pci/drm/i915/display/intel_dp_mst.c

index 8d13d7b..2a20487 100644 (file)
@@ -817,6 +817,7 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo
        ret = drm_connector_init(dev, connector, &intel_dp_mst_connector_funcs,
                                 DRM_MODE_CONNECTOR_DisplayPort);
        if (ret) {
+               drm_dp_mst_put_port_malloc(port);
                intel_connector_free(intel_connector);
                return NULL;
        }