Skip to content

Commit 3383334

Browse files
ideakgregkh
authored andcommitted
drm/mst: Fix error handling during MST sideband message reception
commit 448421b5e93b9177c5698f0cf6f5e72d2995eeca upstream. Handle any error due to partial reads, timeouts etc. to avoid parsing uninitialized data subsequently. Also bail out if the parsing itself fails. Cc: Dave Airlie <airlied@redhat.com> Cc: Lyude <lyude@redhat.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Imre Deak <imre.deak@intel.com> Reviewed-by: Lyude <lyude@redhat.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20170719114330.26540-2-imre.deak@intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent af7b187 commit 3383334

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

drivers/gpu/drm/drm_dp_mst_topology.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2195,11 +2195,17 @@ static void drm_dp_get_one_sb_msg(struct drm_dp_mst_topology_mgr *mgr, bool up)
21952195
ret = drm_dp_dpcd_read(mgr->aux, basereg + curreply,
21962196
replyblock, len);
21972197
if (ret != len) {
2198-
DRM_DEBUG_KMS("failed to read a chunk\n");
2198+
DRM_DEBUG_KMS("failed to read a chunk (len %d, ret %d)\n",
2199+
len, ret);
2200+
return;
21992201
}
2202+
22002203
ret = drm_dp_sideband_msg_build(msg, replyblock, len, false);
2201-
if (ret == false)
2204+
if (!ret) {
22022205
DRM_DEBUG_KMS("failed to build sideband msg\n");
2206+
return;
2207+
}
2208+
22032209
curreply += len;
22042210
replylen -= len;
22052211
}

0 commit comments

Comments
 (0)