Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754537AbbGaTwu (ORCPT ); Fri, 31 Jul 2015 15:52:50 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46427 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754435AbbGaTwl (ORCPT ); Fri, 31 Jul 2015 15:52:41 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Vetter , Dave Airlie Subject: [PATCH 4.1 131/267] drm/dp/mst: take lock around looking up the branch device on hpd irq Date: Fri, 31 Jul 2015 12:39:42 -0700 Message-Id: <20150731194006.064910803@linuxfoundation.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <20150731194001.933895871@linuxfoundation.org> References: <20150731194001.933895871@linuxfoundation.org> User-Agent: quilt/0.64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1354 Lines: 46 4.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dave Airlie 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 Signed-off-by: Dave Airlie Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/drm_dp_mst_topology.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -1171,6 +1171,8 @@ static struct drm_dp_mst_branch *drm_dp_ 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++) { @@ -1190,6 +1192,7 @@ static struct drm_dp_mst_branch *drm_dp_ } } kref_get(&mstb->kref); + mutex_unlock(&mgr->lock); return mstb; } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/