* [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* ✗ Fi.CI.BAT: failure for drm/dp: Make space for null terminator in the DP device ID char array 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 ` Patchwork 2016-11-07 18:59 ` [PATCH] " Pandiyan, Dhinakaran ` (2 subsequent siblings) 3 siblings, 0 replies; 7+ messages in thread From: Patchwork @ 2016-11-04 21:53 UTC (permalink / raw) To: Pandiyan, Dhinakaran; +Cc: intel-gfx == Series Details == Series: drm/dp: Make space for null terminator in the DP device ID char array URL : https://patchwork.freedesktop.org/series/14865/ State : failure == Summary == Series 14865v1 drm/dp: Make space for null terminator in the DP device ID char array https://patchwork.freedesktop.org/api/1.0/series/14865/revisions/1/mbox/ Test gem_ringfill: Subgroup basic-default-hang: pass -> INCOMPLETE (fi-hsw-4770) Test gem_sync: Subgroup basic-store-all: fail -> PASS (fi-hsw-4770r) fi-bdw-5557u total:241 pass:226 dwarn:0 dfail:0 fail:0 skip:15 fi-bsw-n3050 total:241 pass:201 dwarn:0 dfail:0 fail:0 skip:40 fi-bxt-t5700 total:241 pass:213 dwarn:0 dfail:0 fail:0 skip:28 fi-byt-j1900 total:241 pass:213 dwarn:0 dfail:0 fail:0 skip:28 fi-byt-n2820 total:241 pass:209 dwarn:0 dfail:0 fail:0 skip:32 fi-hsw-4770 total:112 pass:102 dwarn:0 dfail:0 fail:0 skip:9 fi-hsw-4770r total:241 pass:221 dwarn:0 dfail:0 fail:0 skip:20 fi-ilk-650 total:241 pass:188 dwarn:0 dfail:0 fail:0 skip:53 fi-ivb-3520m total:241 pass:219 dwarn:0 dfail:0 fail:0 skip:22 fi-ivb-3770 total:241 pass:219 dwarn:0 dfail:0 fail:0 skip:22 fi-kbl-7200u total:241 pass:219 dwarn:0 dfail:0 fail:0 skip:22 fi-skl-6260u total:241 pass:227 dwarn:0 dfail:0 fail:0 skip:14 fi-skl-6700hq total:241 pass:220 dwarn:0 dfail:0 fail:0 skip:21 fi-skl-6700k total:241 pass:219 dwarn:1 dfail:0 fail:0 skip:21 fi-skl-6770hq total:241 pass:227 dwarn:0 dfail:0 fail:0 skip:14 fi-snb-2520m total:241 pass:209 dwarn:0 dfail:0 fail:0 skip:32 fi-snb-2600 total:241 pass:208 dwarn:0 dfail:0 fail:0 skip:33 49a651a2e66ef603995f88a470d0986c2ef8b5b8 drm-intel-nightly: 2016y-11m-04d-18h-04m-36s UTC integration manifest 08543dd drm/dp: Make space for null terminator in the DP device ID char array == Logs == For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_2911/ _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] drm/dp: Make space for null terminator in the DP device ID char array 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 ` Pandiyan, Dhinakaran 2016-11-07 19:16 ` Jani Nikula 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 3 siblings, 0 replies; 7+ messages in thread From: Pandiyan, Dhinakaran @ 2016-11-07 18:59 UTC (permalink / raw) To: dri-devel@lists.freedesktop.org; +Cc: intel-gfx@lists.freedesktop.org Mika, Can you take a look at this? -DK On Fri, 2016-11-04 at 14:06 -0700, Dhinakaran Pandiyan wrote: > 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; _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] drm/dp: Make space for null terminator in the DP device ID char array 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-07 23:45 ` ✓ Fi.CI.BAT: success for drm/dp: Make space for null terminator in the DP device ID char array (rev2) Patchwork 3 siblings, 1 reply; 7+ messages in thread From: Jani Nikula @ 2016-11-07 19:16 UTC (permalink / raw) To: dri-devel; +Cc: intel-gfx, Dhinakaran Pandiyan On Fri, 04 Nov 2016, Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> wrote: > 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] = ""; Or use %*pE in the format string and provide the length. BR, Jani. > int len; > uint8_t rev[2]; > int type = port_cap[0] & DP_DS_PORT_TYPE_MASK; -- Jani Nikula, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2] drm/dp: Make space for null terminator in the DP device ID char array 2016-11-07 19:16 ` Jani Nikula @ 2016-11-07 23:22 ` Dhinakaran Pandiyan 2016-11-15 0:04 ` Pandiyan, Dhinakaran 0 siblings, 1 reply; 7+ messages in thread From: Dhinakaran Pandiyan @ 2016-11-07 23:22 UTC (permalink / raw) To: intel-gfx; +Cc: 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. v2: Use %*pE format specifier (Jani) Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> --- drivers/gpu/drm/drm_dp_helper.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c index 3e6fe82..2d42760 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[6] = ""; int len; uint8_t rev[2]; int type = port_cap[0] & DP_DS_PORT_TYPE_MASK; @@ -584,7 +584,8 @@ void drm_dp_downstream_debug(struct seq_file *m, } drm_dp_downstream_id(aux, id); - seq_printf(m, "\t\tID: %s\n", id); + len = strnlen(id, 6); + seq_printf(m, "\t\tID: %*pE\n", len, id); len = drm_dp_dpcd_read(aux, DP_BRANCH_HW_REV, &rev[0], 1); if (len > 0) -- 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
* Re: [PATCH v2] drm/dp: Make space for null terminator in the DP device ID char array 2016-11-07 23:22 ` [PATCH v2] " Dhinakaran Pandiyan @ 2016-11-15 0:04 ` Pandiyan, Dhinakaran 0 siblings, 0 replies; 7+ messages in thread From: Pandiyan, Dhinakaran @ 2016-11-15 0:04 UTC (permalink / raw) To: intel-gfx@lists.freedesktop.org; +Cc: dri-devel@lists.freedesktop.org Adding Cc's. On Mon, 2016-11-07 at 15:22 -0800, Dhinakaran Pandiyan wrote: > 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. > > v2: Use %*pE format specifier (Jani) > > Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> > --- > drivers/gpu/drm/drm_dp_helper.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c > index 3e6fe82..2d42760 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[6] = ""; > int len; > uint8_t rev[2]; > int type = port_cap[0] & DP_DS_PORT_TYPE_MASK; > @@ -584,7 +584,8 @@ void drm_dp_downstream_debug(struct seq_file *m, > } > > drm_dp_downstream_id(aux, id); > - seq_printf(m, "\t\tID: %s\n", id); > + len = strnlen(id, 6); > + seq_printf(m, "\t\tID: %*pE\n", len, id); > > len = drm_dp_dpcd_read(aux, DP_BRANCH_HW_REV, &rev[0], 1); > if (len > 0) _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 7+ messages in thread
* ✓ Fi.CI.BAT: success for drm/dp: Make space for null terminator in the DP device ID char array (rev2) 2016-11-04 21:06 [PATCH] drm/dp: Make space for null terminator in the DP device ID char array Dhinakaran Pandiyan ` (2 preceding siblings ...) 2016-11-07 19:16 ` Jani Nikula @ 2016-11-07 23:45 ` Patchwork 3 siblings, 0 replies; 7+ messages in thread From: Patchwork @ 2016-11-07 23:45 UTC (permalink / raw) To: Pandiyan, Dhinakaran; +Cc: intel-gfx == Series Details == Series: drm/dp: Make space for null terminator in the DP device ID char array (rev2) URL : https://patchwork.freedesktop.org/series/14865/ State : success == Summary == Series 14865v2 drm/dp: Make space for null terminator in the DP device ID char array https://patchwork.freedesktop.org/api/1.0/series/14865/revisions/2/mbox/ fi-bdw-5557u total:241 pass:226 dwarn:0 dfail:0 fail:0 skip:15 fi-bsw-n3050 total:241 pass:201 dwarn:0 dfail:0 fail:0 skip:40 fi-byt-j1900 total:241 pass:213 dwarn:0 dfail:0 fail:0 skip:28 fi-byt-n2820 total:241 pass:209 dwarn:0 dfail:0 fail:0 skip:32 fi-hsw-4770 total:241 pass:221 dwarn:0 dfail:0 fail:0 skip:20 fi-hsw-4770r total:241 pass:221 dwarn:0 dfail:0 fail:0 skip:20 fi-ilk-650 total:241 pass:188 dwarn:0 dfail:0 fail:0 skip:53 fi-ivb-3520m total:241 pass:219 dwarn:0 dfail:0 fail:0 skip:22 fi-ivb-3770 total:241 pass:219 dwarn:0 dfail:0 fail:0 skip:22 fi-skl-6260u total:241 pass:227 dwarn:0 dfail:0 fail:0 skip:14 fi-skl-6700hq total:241 pass:220 dwarn:0 dfail:0 fail:0 skip:21 fi-skl-6700k total:241 pass:219 dwarn:1 dfail:0 fail:0 skip:21 fi-skl-6770hq total:241 pass:227 dwarn:0 dfail:0 fail:0 skip:14 fi-snb-2520m total:241 pass:209 dwarn:0 dfail:0 fail:0 skip:32 fi-snb-2600 total:241 pass:208 dwarn:0 dfail:0 fail:0 skip:33 0cb521ab1e777031c1fbb5fb2b0a5b13ccb9c461 drm-intel-nightly: 2016y-11m-07d-20h-58m-10s UTC integration manifest c3f76a9 drm/dp: Make space for null terminator in the DP device ID char array == Logs == For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_2927/ _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [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).