From f6f081b8f7a960be8f8b1d8ac19350862816daec Mon Sep 17 00:00:00 2001 From: jsg Date: Thu, 2 Feb 2023 04:07:54 +0000 Subject: [PATCH] drm/display/dp_mst: Correct the kref of port. From Wayne Lin 335ef7d0777c5609d5fadb5b73b96c538fa8fc93 in linux-6.1.y/6.1.9 d8bf2df715bb8ac964f91fe8bf67c37c5d916463 in mainline linux --- sys/dev/pci/drm/display/drm_dp_mst_topology.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/drm/display/drm_dp_mst_topology.c b/sys/dev/pci/drm/display/drm_dp_mst_topology.c index d9765de0f33..ef500fac5f1 100644 --- a/sys/dev/pci/drm/display/drm_dp_mst_topology.c +++ b/sys/dev/pci/drm/display/drm_dp_mst_topology.c @@ -3382,6 +3382,9 @@ void drm_dp_remove_payload(struct drm_dp_mst_topology_mgr *mgr, mgr->payload_count--; mgr->next_start_slot -= payload->time_slots; + + if (payload->delete) + drm_dp_mst_put_port_malloc(payload->port); } EXPORT_SYMBOL(drm_dp_remove_payload); @@ -4337,7 +4340,6 @@ int drm_dp_atomic_release_time_slots(struct drm_atomic_state *state, drm_dbg_atomic(mgr->dev, "[MST PORT:%p] TU %d -> 0\n", port, payload->time_slots); if (!payload->delete) { - drm_dp_mst_put_port_malloc(port); payload->pbn = 0; payload->delete = true; topology_state->payload_mask &= ~BIT(payload->vcpi - 1); -- 2.20.1