[PATCH] drm/dp/mst: Fix missing ref count decrease
From: Harry Wentland
Date: Tue Feb 09 2016 - 09:33:11 EST
Decrease ref count for port on all exit conditions.
Signed-off-by: Harry Wentland <harry.wentland@xxxxxxx>
Reviewed-by: Mykola Lysenko <mykola.lysenko@xxxxxxx>
---
drivers/gpu/drm/drm_dp_mst_topology.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
index 5662e68ecccd..fa50fd0cb5ef 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -2498,7 +2498,8 @@ bool drm_dp_mst_allocate_vcpi(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp
DRM_DEBUG_KMS("payload: vcpi %d already allocated for pbn %d - requested pbn %d\n", port->vcpi.vcpi, port->vcpi.pbn, pbn);
if (pbn == port->vcpi.pbn) {
*slots = port->vcpi.num_slots;
- return true;
+ ret = 0;
+ goto out;
}
}
@@ -2510,10 +2511,10 @@ bool drm_dp_mst_allocate_vcpi(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp
DRM_DEBUG_KMS("initing vcpi for %d %d\n", pbn, port->vcpi.num_slots);
*slots = port->vcpi.num_slots;
- drm_dp_put_port(port);
- return true;
+ ret = 0;
out:
- return false;
+ drm_dp_put_port(port);
+ return ret == 0;
}
EXPORT_SYMBOL(drm_dp_mst_allocate_vcpi);
--
2.1.4
--------------050702040803040104090205--