drm/mst: Don't use uninitialized fields of the sideband message header
Subsystems (2)
PATCH 1/1 drm/mst: 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 <[email protected]>
--- drivers/gpu/drm/drm_dp_mst_topology.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/drm_dp_mst_topology.c +2 -0
@@ -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 ;
Signature · 1 line
1.8.3.1
Quoted 7 lines · Damien Lespiau
We could be using uninitialized fields of the header in
drm_dp_encode_sideband_msg_hdr(), for instancehdr->somtis 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 <[email protected]>
Both pulled into topic/core-stuff with the summary tag bikeshedded to drm/dp-helper.
-Daniel
Quoted 24 lines
--- drivers/gpu/drm/drm_dp_mst_topology.c | 2 ++ 1 file changed, 2 insertions(+)drivers/gpu/drm/drm_dp_mst_topology.c +2
-0@@ -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 ;Signature · 6 lines
1.8.3.1 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch