[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190116203759.31820-3-lyude@redhat.com>
Date: Wed, 16 Jan 2019 15:37:58 -0500
From: Lyude Paul <lyude@...hat.com>
To: dri-devel@...ts.freedesktop.org
Cc: Daniel Vetter <daniel@...ll.ch>, David Airlie <airlied@...ux.ie>,
Harry Wentland <harry.wentland@....com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <maxime.ripard@...tlin.com>,
Sean Paul <sean@...rly.run>, linux-kernel@...r.kernel.org
Subject: [PATCH 2/3] drm/dp_mst: Fix potential topology ref leak in drm_dp_atomic_find_vcpi_slots()
This is a very minute issue I introduced that I just noticed when
scrolling through drm_dp_mst_topology.c: if a driver uses
drm_dp_atomic_find_vcpi_slots() incorrectly, we'll forget to release the
topology reference we grabbed on port.
So, fix this by jumping to 'out' instead of returning -EINVAL
immediately.
Signed-off-by: Lyude Paul <lyude@...hat.com>
Fixes: eceae1472467 ("drm/dp_mst: Start tracking per-port VCPI allocations")
Cc: Daniel Vetter <daniel@...ll.ch>
Cc: David Airlie <airlied@...ux.ie>
Cc: Harry Wentland <harry.wentland@....com>
Signed-off-by: Lyude Paul <lyude@...hat.com>
---
drivers/gpu/drm/drm_dp_mst_topology.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
index 49575b80caeb..d99560c5c693 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -3070,7 +3070,8 @@ int drm_dp_atomic_find_vcpi_slots(struct drm_atomic_state *state,
if (WARN_ON(!prev_slots)) {
DRM_ERROR("cannot allocate and release VCPI on [MST PORT:%p] in the same state\n",
port);
- return -EINVAL;
+ ret = -EINVAL;
+ goto out;
}
break;
--
2.20.1
Powered by blists - more mailing lists