Skip to content

Commit

Permalink
drm/mst: Avoid dereferencing a NULL mstb in drm_dp_mst_handle_up_req()
Browse files Browse the repository at this point in the history
In case of an unknown broadcast message is sent mstb will remain unset,
so check for this.

Cc: Dave Airlie <[email protected]>
Cc: Lyude <[email protected]>
Cc: Daniel Vetter <[email protected]>
Signed-off-by: Imre Deak <[email protected]>
Reviewed-by: Lyude <[email protected]>
Cc: [email protected]
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
ideak authored and danvet committed Jul 20, 2017
1 parent 448421b commit 7f8b398
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/gpu/drm/drm_dp_mst_topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -2324,7 +2324,9 @@ static int drm_dp_mst_handle_up_req(struct drm_dp_mst_topology_mgr *mgr)
DRM_DEBUG_KMS("Got RSN: pn: %d avail_pbn %d\n", msg.u.resource_stat.port_number, msg.u.resource_stat.available_pbn);
}

drm_dp_put_mst_branch_device(mstb);
if (mstb)
drm_dp_put_mst_branch_device(mstb);

memset(&mgr->up_req_recv, 0, sizeof(struct drm_dp_sideband_msg_rx));
}
return ret;
Expand Down

0 comments on commit 7f8b398

Please sign in to comment.