drm/display/dp_mst: Don't validate port refs in drm_dp_check_and_send_link_address()
Drive-by cleanup, we don't need to validate the port references here as we already previously went through the effort of refactoring things such that we're guaranteed to be able to access ->mstb and ->port safely from drm_dp_check_and_send_link_address(), since the only two places in the codebase that drop an MST reference in such a way that it would remove it from the topology are both protected under probe_lock. Thanks for that, past Lyude! Signed-off-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Wayne Lin <Wayne.Lin@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220602201757.30431-2-lyude@redhat.com
This commit is contained in:
parent
e1b7234b4a
commit
e21c3adc6f
|
@ -2667,24 +2667,14 @@ static int drm_dp_check_and_send_link_address(struct drm_dp_mst_topology_mgr *mg
|
||||||
}
|
}
|
||||||
|
|
||||||
list_for_each_entry(port, &mstb->ports, next) {
|
list_for_each_entry(port, &mstb->ports, next) {
|
||||||
struct drm_dp_mst_branch *mstb_child = NULL;
|
if (port->input || !port->ddps || !port->mstb)
|
||||||
|
|
||||||
if (port->input || !port->ddps)
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (port->mstb)
|
ret = drm_dp_check_and_send_link_address(mgr, port->mstb);
|
||||||
mstb_child = drm_dp_mst_topology_get_mstb_validated(
|
if (ret == 1)
|
||||||
mgr, port->mstb);
|
changed = true;
|
||||||
|
else if (ret < 0)
|
||||||
if (mstb_child) {
|
return ret;
|
||||||
ret = drm_dp_check_and_send_link_address(mgr,
|
|
||||||
mstb_child);
|
|
||||||
drm_dp_mst_topology_put_mstb(mstb_child);
|
|
||||||
if (ret == 1)
|
|
||||||
changed = true;
|
|
||||||
else if (ret < 0)
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return changed;
|
return changed;
|
||||||
|
|
Loading…
Reference in New Issue