diff mbox

[igt] lib/kms: Clear unused fields for getproperty ioctl

Message ID 20170809101337.29391-1-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson Aug. 9, 2017, 10:13 a.m. UTC
==24749== Syscall param ioctl(generic) points to uninitialised byte(s)
==24749==    at 0x6A8ADC7: ioctl (syscall-template.S:84)
==24749==    by 0x5067687: drmIoctl (in /opt/xorg/lib64/libdrm.so.2.4.0)
==24749==    by 0x138531: kmstest_set_connector_dpms (igt_kms.c:1022)
==24749==    by 0x112937: set_dpms (kms_flip.c:263)
==24749==    by 0x112937: run_test_step (kms_flip.c:776)
==24749==    by 0x112937: event_loop (kms_flip.c:1138)
==24749==    by 0x115468: run_test_on_crtc_set (kms_flip.c:1378)
==24749==    by 0x115468: run_test (kms_flip.c:1450)
==24749==    by 0x1111CF: main (kms_flip.c:1673)
==24749==  Address 0x1ffefff2a0 is on thread 1's stack
==24749==  in frame #2, created by kmstest_set_connector_dpms (igt_kms.c:1012)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 lib/igt_kms.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Mika Kuoppala Aug. 9, 2017, 10:58 a.m. UTC | #1
Chris Wilson <chris@chris-wilson.co.uk> writes:

> ==24749== Syscall param ioctl(generic) points to uninitialised byte(s)
> ==24749==    at 0x6A8ADC7: ioctl (syscall-template.S:84)
> ==24749==    by 0x5067687: drmIoctl (in /opt/xorg/lib64/libdrm.so.2.4.0)
> ==24749==    by 0x138531: kmstest_set_connector_dpms (igt_kms.c:1022)
> ==24749==    by 0x112937: set_dpms (kms_flip.c:263)
> ==24749==    by 0x112937: run_test_step (kms_flip.c:776)
> ==24749==    by 0x112937: event_loop (kms_flip.c:1138)
> ==24749==    by 0x115468: run_test_on_crtc_set (kms_flip.c:1378)
> ==24749==    by 0x115468: run_test (kms_flip.c:1450)
> ==24749==    by 0x1111CF: main (kms_flip.c:1673)
> ==24749==  Address 0x1ffefff2a0 is on thread 1's stack
> ==24749==  in frame #2, created by kmstest_set_connector_dpms (igt_kms.c:1012)
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>

> ---
>  lib/igt_kms.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index 9fe800d1..0c6dbf74 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -1014,11 +1014,10 @@ void kmstest_set_connector_dpms(int fd, drmModeConnector *connector, int mode)
>  	bool found_it = false;
>  
>  	for (i = 0; i < connector->count_props; i++) {
> -		struct drm_mode_get_property prop;
> +		struct drm_mode_get_property prop = {
> +			.prop_id = connector->props[i],
> +		};
>  
> -		prop.prop_id = connector->props[i];
> -		prop.count_values = 0;
> -		prop.count_enum_blobs = 0;
>  		if (drmIoctl(fd, DRM_IOCTL_MODE_GETPROPERTY, &prop))
>  			continue;
>  
> -- 
> 2.13.3
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 9fe800d1..0c6dbf74 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -1014,11 +1014,10 @@  void kmstest_set_connector_dpms(int fd, drmModeConnector *connector, int mode)
 	bool found_it = false;
 
 	for (i = 0; i < connector->count_props; i++) {
-		struct drm_mode_get_property prop;
+		struct drm_mode_get_property prop = {
+			.prop_id = connector->props[i],
+		};
 
-		prop.prop_id = connector->props[i];
-		prop.count_values = 0;
-		prop.count_enum_blobs = 0;
 		if (drmIoctl(fd, DRM_IOCTL_MODE_GETPROPERTY, &prop))
 			continue;