From: Damien Lespiau Date: Mon, 14 Jul 2014 11:13:18 +0000 (+0100) Subject: drm/dp-mst-helper: Don't use uninitialized fields of the sideband message header X-Git-Tag: MMI-PSA29.97-13-9~11757^2~48^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bf3719c04ee3322b0f6d13c078e3ca4c3b7e3ead;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 Signed-off-by: Daniel Vetter --- 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;