drm/dp-mst-helper: Don't use uninitialized fields of the sideband message header
authorDamien Lespiau <damien.lespiau@intel.com>
Mon, 14 Jul 2014 11:13:18 +0000 (12:13 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 18 Jul 2014 13:39:29 +0000 (15:39 +0200)
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>
drivers/gpu/drm/drm_dp_mst_topology.c

index 813b8d186691e86a2b6489e49c62e7ee81ab50bf..618526db263f8d58e1028be775857033effeb290 100644 (file)
@@ -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;