diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2017-08-14 02:07:07 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2017-08-14 02:07:07 +0000 |
commit | 82d4d9f308b8b30d4ab584906fd464ef17bc2824 (patch) | |
tree | d9083ae92537b4eb05725c38b77f5759f94ed30e | |
parent | 900e35397aa3c440001198955c1be5124276f821 (diff) |
drm/mst: Fix error handling during MST sideband message reception
From Imre Deak
3383334a6cf38af6843793e343c95081b02773f1 in linux-4.4.y/4.4.79
448421b5e93b9177c5698f0cf6f5e72d2995eeca in mainline linux
ok kettenis@
-rw-r--r-- | sys/dev/pci/drm/drm_dp_mst_topology.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/dev/pci/drm/drm_dp_mst_topology.c b/sys/dev/pci/drm/drm_dp_mst_topology.c index 361964eb13d..07e7cbbd622 100644 --- a/sys/dev/pci/drm/drm_dp_mst_topology.c +++ b/sys/dev/pci/drm/drm_dp_mst_topology.c @@ -2199,11 +2199,17 @@ static void drm_dp_get_one_sb_msg(struct drm_dp_mst_topology_mgr *mgr, bool up) ret = drm_dp_dpcd_read(mgr->aux, basereg + curreply, replyblock, len); if (ret != len) { - DRM_DEBUG_KMS("failed to read a chunk\n"); + DRM_DEBUG_KMS("failed to read a chunk (len %d, ret %d)\n", + len, ret); + return; } + ret = drm_dp_sideband_msg_build(msg, replyblock, len, false); - if (ret == false) + if (!ret) { DRM_DEBUG_KMS("failed to build sideband msg\n"); + return; + } + curreply += len; replylen -= len; } |