aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_dp_mst_topology.c
diff options
context:
space:
mode:
authorDamien Lespiau <damien.lespiau@intel.com>2014-07-14 12:13:18 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-07-18 15:39:29 +0200
commitbf3719c04ee3322b0f6d13c078e3ca4c3b7e3ead (patch)
tree4e3e1ad856993e300fb62d0a3d5d1451efd4bba3 /drivers/gpu/drm/drm_dp_mst_topology.c
parentdrm/dp-mst-helper: Avoid reading uninitialized value (diff)
downloadlinux-dev-bf3719c04ee3322b0f6d13c078e3ca4c3b7e3ead.tar.xz
linux-dev-bf3719c04ee3322b0f6d13c078e3ca4c3b7e3ead.zip
drm/dp-mst-helper: Don't use uninitialized fields of the sideband message header
We could be using uninitialized fields of the header in drm_dp_encode_sideband_msg_hdr(), for instance hdr->somt is set to 1 in the first patcket but never set to 0 otherwise. Always clear the header at the start then. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/drm_dp_mst_topology.c')
-rw-r--r--drivers/gpu/drm/drm_dp_mst_topology.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
index 813b8d186691..618526db263f 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -1290,6 +1290,8 @@ static int process_single_tx_qlock(struct drm_dp_mst_topology_mgr *mgr,
int len, space, idx, tosend;
int ret;
+ memset(&hdr, 0, sizeof(struct drm_dp_sideband_msg_hdr));
+
if (txmsg->state == DRM_DP_SIDEBAND_TX_QUEUED) {
txmsg->seqno = -1;
txmsg->state = DRM_DP_SIDEBAND_TX_START_SEND;