diff options
author | 2017-08-14 02:07:06 +0000 | |
---|---|---|
committer | 2017-08-14 02:07:06 +0000 | |
commit | 7b625705a2b7bb81c59feee2820d52d546d733f2 (patch) | |
tree | 2ce618b9d953ee5723bdd7578d65b0ebcb961087 | |
parent | Make the vga_client_register() stub available to all archs to unbreak (diff) | |
download | wireguard-openbsd-7b625705a2b7bb81c59feee2820d52d546d733f2.tar.xz wireguard-openbsd-7b625705a2b7bb81c59feee2820d52d546d733f2.zip |
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; } |