3.19.8-ckt4 -stable review patch.  If anyone has any objections, please let me 
know.

------------------

From: Dave Airlie <airl...@redhat.com>

commit 9eb1e57f564d4e6e10991402726cc83fe0b9172f upstream.

If we are doing an MST transaction and we've gotten HPD and we
lookup the device from the incoming msg, we should take the mgr
lock around it, so that mst_primary and mstb->ports are valid.

Reviewed-by: Daniel Vetter <daniel.vet...@ffwll.ch>
Signed-off-by: Dave Airlie <airl...@redhat.com>
Signed-off-by: Kamal Mostafa <ka...@canonical.com>
---
 drivers/gpu/drm/drm_dp_mst_topology.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c 
b/drivers/gpu/drm/drm_dp_mst_topology.c
index e0da405..4d7a4d9 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -1159,6 +1159,8 @@ static struct drm_dp_mst_branch 
*drm_dp_get_mst_branch_device(struct drm_dp_mst_
        struct drm_dp_mst_port *port;
        int i;
        /* find the port by iterating down */
+
+       mutex_lock(&mgr->lock);
        mstb = mgr->mst_primary;
 
        for (i = 0; i < lct - 1; i++) {
@@ -1178,6 +1180,7 @@ static struct drm_dp_mst_branch 
*drm_dp_get_mst_branch_device(struct drm_dp_mst_
                }
        }
        kref_get(&mstb->kref);
+       mutex_unlock(&mgr->lock);
        return mstb;
 }
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to