intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/dp: Make space for null terminator in the DP device ID char array
@ 2016-11-04 21:06 Dhinakaran Pandiyan
  2016-11-04 21:53 ` ✗ Fi.CI.BAT: failure for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Dhinakaran Pandiyan @ 2016-11-04 21:06 UTC (permalink / raw)
  To: dri-devel; +Cc: intel-gfx, Dhinakaran Pandiyan

The DP device identification string read from the DPCD registers is 6
characters long at max. and we store it in a char array of the same length
without space for the NULL terminator. Fix this by increasing the array
size to 7 and initialize it to an empty string.

Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
---
 drivers/gpu/drm/drm_dp_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
index 3e6fe82..3a39312 100644
--- a/drivers/gpu/drm/drm_dp_helper.c
+++ b/drivers/gpu/drm/drm_dp_helper.c
@@ -544,7 +544,7 @@ void drm_dp_downstream_debug(struct seq_file *m,
 				 DP_DETAILED_CAP_INFO_AVAILABLE;
 	int clk;
 	int bpc;
-	char id[6];
+	char id[7] = "";
 	int len;
 	uint8_t rev[2];
 	int type = port_cap[0] & DP_DS_PORT_TYPE_MASK;
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-11-15  0:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-04 21:06 [PATCH] drm/dp: Make space for null terminator in the DP device ID char array Dhinakaran Pandiyan
2016-11-04 21:53 ` ✗ Fi.CI.BAT: failure for " Patchwork
2016-11-07 18:59 ` [PATCH] " Pandiyan, Dhinakaran
2016-11-07 19:16 ` Jani Nikula
2016-11-07 23:22   ` [PATCH v2] " Dhinakaran Pandiyan
2016-11-15  0:04     ` Pandiyan, Dhinakaran
2016-11-07 23:45 ` ✓ Fi.CI.BAT: success for drm/dp: Make space for null terminator in the DP device ID char array (rev2) Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).