From 1d425aa6a14b7d877d6a52eb681d6dfe9e31c610 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Sun, 1 Apr 2018 12:53:52 +0200 Subject: [PATCH] DRM fix Signed-off-by: Jiri Slaby --- drivers/gpu/drm/drm_dp_mst_topology.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c index 70dcfa58d3c2..f07bfb5f4073 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -1288,7 +1288,10 @@ static struct drm_dp_mst_branch *drm_dp_get_mst_branch_device(struct drm_dp_mst_ } } } - kref_get(&mstb->kref); + if (WARN_ON_ONCE(!mstb)) + ; + else + kref_get(&mstb->kref); out: mutex_unlock(&mgr->lock); return mstb; -- 2.16.3