浏览代码

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>
Damien Lespiau 11 年之前
父节点
当前提交
bf3719c04e
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      drivers/gpu/drm/drm_dp_mst_topology.c

+ 2 - 0
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 len, space, idx, tosend;
 	int ret;
 	int ret;
 
 
+	memset(&hdr, 0, sizeof(struct drm_dp_sideband_msg_hdr));
+
 	if (txmsg->state == DRM_DP_SIDEBAND_TX_QUEUED) {
 	if (txmsg->state == DRM_DP_SIDEBAND_TX_QUEUED) {
 		txmsg->seqno = -1;
 		txmsg->seqno = -1;
 		txmsg->state = DRM_DP_SIDEBAND_TX_START_SEND;
 		txmsg->state = DRM_DP_SIDEBAND_TX_START_SEND;