Skip to contentSkip to conversation

chamelium: Fix analog bridge detection memory leak

PATCH In review Paul Kocialkowski 3 participants 6 messages Nov 14, 2018 – Dec 4, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 chamelium: Fix analog bridge detection memory leak

The connector and EDID blob retrieved when checking for analog bridges need to be freed before returning from the associated function.

Fixes f8d6afa67 ("tests/chamelium: Detect analog bridges and handle

EDID accordingly")

---
 tests/kms_chamelium.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
tests/kms_chamelium.c +6 -4
index e0e3e3f1..55b346a9 100644
@@ -175,8 +175,10 @@ check_analog_bridge(data_t *data, struct chamelium_port *port)
 	unsigned char *edid;
 	char edid_vendor[3];
 
-	if (chamelium_port_get_type(port) != DRM_MODE_CONNECTOR_VGA)
+	if (chamelium_port_get_type(port) != DRM_MODE_CONNECTOR_VGA) {
+		drmModeFreeConnector(connector);
 		return false;
+	}
 
 	igt_assert(kmstest_get_property(data->drm_fd, connector->connector_id,
 					DRM_MODE_OBJECT_CONNECTOR, "EDID", NULL,
@@ -191,14 +193,14 @@ check_analog_bridge(data_t *data, struct chamelium_port *port)
 			  ((edid[9] & 0xe0) >> 5)) + '@';
 	edid_vendor[2] = (edid[9] & 0x1f) + '@';
 
+	drmModeFreePropertyBlob(edid_blob);
+	drmModeFreeConnector(connector);
+
 	/* Analog bridges provide their own EDID */
 	if (edid_vendor[0] != 'I' || edid_vendor[1] != 'G' ||
 	    edid_vendor[0] != 'T')
 		return true;
 
-	drmModeFreePropertyBlob(edid_blob);
-	drmModeFreeConnector(connector);
-
 	return false;
 }
 
Signature · 6 lines
2.19.1

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#1 lore raw

[igt-dev] ✓ Fi.CI.BAT: success for chamelium: Fix analog bridge detection memory leak

== Series Details ==

== Series Details ==

Series: chamelium: Fix analog bridge detection memory leak
URL : https://patchwork.freedesktop.org/series/52492/
State : success

== Summary ==

= CI Bug Log - changes from IGT_4714 -> IGTPW_2060 =

== Summary - WARNING ==

Minor unknown changes coming with IGTPW_2060 need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in IGTPW_2060, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://patchwork.freedesktop.org/api/1.0/series/52492/revisions/1/mbox/

== Possible new issues ==

Here are the unknown changes that may have been introduced in IGTPW_2060:

=== IGT changes ===

    ==== Warnings ====

    igt@drv_selftest@live_guc:
      fi-skl-iommu:       PASS -> SKIP +1

    igt@kms_flip@basic-flip-vs-modeset:
      fi-kbl-x1275:       SKIP -> PASS +36

    igt@pm_rpm@basic-rte:
      fi-kbl-7567u:       PASS -> SKIP +4

    igt@prime_vgem@basic-fence-flip:
      fi-cfl-s3:          SKIP -> PASS

== Known issues ==

Here are the changes found in IGTPW_2060 that come from known issues:

=== IGT changes ===

    ==== Issues hit ====

    igt@drv_module_reload@basic-reload-inject:
      fi-kbl-7567u:       PASS -> DMESG-WARN (fdo#108529, fdo#105602) +1

    igt@drv_selftest@live_contexts:
      fi-icl-u:           NOTRUN -> INCOMPLETE (fdo#108315)

    igt@drv_selftest@live_hangcheck:
      fi-skl-iommu:       PASS -> INCOMPLETE (fdo#108744, fdo#108602)

    igt@kms_pipe_crc_basic@hang-read-crc-pipe-a:
      fi-byt-clapper:     PASS -> FAIL (fdo#103191, fdo#107362)

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
      fi-kbl-7567u:       PASS -> DMESG-FAIL (fdo#105079)

    igt@pm_rpm@module-reload:
      fi-kbl-7567u:       PASS -> DMESG-WARN (fdo#108529)

    
    ==== Possible fixes ====

    igt@drv_module_reload@basic-reload:
      fi-blb-e6850:       INCOMPLETE (fdo#107718) -> PASS

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
      fi-byt-clapper:     FAIL (fdo#103191, fdo#107362) -> PASS

fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
fdo#105079 https://bugs.freedesktop.org/show_bug.cgi?id=105079
fdo#105602 https://bugs.freedesktop.org/show_bug.cgi?id=105602
fdo#107362 https://bugs.freedesktop.org/show_bug.cgi?id=107362
fdo#107718 https://bugs.freedesktop.org/show_bug.cgi?id=107718
fdo#108315 https://bugs.freedesktop.org/show_bug.cgi?id=108315
fdo#108529 https://bugs.freedesktop.org/show_bug.cgi?id=108529
fdo#108602 https://bugs.freedesktop.org/show_bug.cgi?id=108602
fdo#108744 https://bugs.freedesktop.org/show_bug.cgi?id=108744

== Participating hosts (53 -> 46) ==

Additional (1): fi-icl-u
Missing (8): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-icl-u2 fi-bsw-cyan fi-snb-2520m fi-ctg-p8600

== Build changes ==

* IGT: IGT_4714 -> IGTPW_2060

CI_DRM_5106: 852b9329fbb6ea8bdbb3dac78328aae73d919305 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2060: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2060/
IGT_4714: cab148ca3ec904a94d0cd43476cf7e1f8663f906 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2060/issues.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#2 lore raw

[igt-dev] ✓ Fi.CI.IGT: success for chamelium: Fix analog bridge detection memory leak

In reply to Paul Kocialkowski
== Series Details ==

== Series Details ==

Series: chamelium: Fix analog bridge detection memory leak
URL : https://patchwork.freedesktop.org/series/52492/
State : success

== Summary ==

= CI Bug Log - changes from IGT_4714_full -> IGTPW_2060_full =

== Summary - WARNING ==

Minor unknown changes coming with IGTPW_2060_full need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in IGTPW_2060_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://patchwork.freedesktop.org/api/1.0/series/52492/revisions/1/mbox/

== Possible new issues ==

Here are the unknown changes that may have been introduced in IGTPW_2060_full:

=== IGT changes ===

    ==== Warnings ====

    igt@pm_rc6_residency@rc6-accuracy:
      shard-kbl:          PASS -> SKIP
      shard-snb:          SKIP -> PASS

== Known issues ==

Here are the changes found in IGTPW_2060_full that come from known issues:

=== IGT changes ===

    ==== Issues hit ====

    igt@gem_exec_blt@dumb-buf-max:
      shard-snb:          PASS -> INCOMPLETE (fdo#105411)

    igt@gem_workarounds@suspend-resume-context:
      shard-kbl:          PASS -> INCOMPLETE (fdo#103665)

    igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-c:
      shard-kbl:          NOTRUN -> DMESG-WARN (fdo#107956) +1

    igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-a:
      shard-apl:          PASS -> DMESG-WARN (fdo#107956)

    igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-c:
      shard-glk:          NOTRUN -> DMESG-WARN (fdo#107956) +1

    igt@kms_color@pipe-a-ctm-max:
      shard-apl:          PASS -> FAIL (fdo#108147)

    igt@kms_color@pipe-a-degamma:
      shard-apl:          PASS -> FAIL (fdo#104782, fdo#108145)

    igt@kms_color@pipe-c-legacy-gamma:
      shard-apl:          PASS -> FAIL (fdo#104782)

    igt@kms_cursor_crc@cursor-128x42-onscreen:
      shard-kbl:          PASS -> FAIL (fdo#103232) +1

    igt@kms_cursor_crc@cursor-256x256-onscreen:
      shard-glk:          NOTRUN -> FAIL (fdo#103232)

    igt@kms_cursor_crc@cursor-256x85-sliding:
      shard-kbl:          PASS -> DMESG-WARN (fdo#105602, fdo#103313, fdo#103558) +9

    igt@kms_cursor_crc@cursor-64x21-random:
      shard-apl:          PASS -> FAIL (fdo#103232) +11

    igt@kms_cursor_legacy@cursorb-vs-flipb-toggle:
      shard-glk:          PASS -> DMESG-WARN (fdo#106538, fdo#105763) +2

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-gtt:
      shard-apl:          PASS -> FAIL (fdo#103167) +4

    igt@kms_frontbuffer_tracking@fbc-1p-rte:
      shard-apl:          PASS -> FAIL (fdo#103167, fdo#105682)

    igt@kms_frontbuffer_tracking@fbc-2p-primscrn-cur-indfb-move:
      shard-glk:          PASS -> DMESG-FAIL (fdo#106538)

    igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-draw-blt:
      shard-glk:          NOTRUN -> FAIL (fdo#103167) +2

    igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-draw-mmap-cpu:
      shard-glk:          PASS -> FAIL (fdo#103167) +2

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
      shard-kbl:          PASS -> DMESG-WARN (fdo#105602, fdo#103313, fdo#103558, fdo#105079)

    igt@kms_plane@pixel-format-pipe-a-planes:
      shard-kbl:          PASS -> FAIL (fdo#103166)
      shard-glk:          PASS -> FAIL (fdo#103166)

    igt@kms_plane@plane-position-covered-pipe-a-planes:
      shard-glk:          NOTRUN -> FAIL (fdo#103166) +1

    igt@kms_plane_alpha_blend@pipe-c-alpha-transparant-fb:
      shard-glk:          NOTRUN -> FAIL (fdo#108145) +7

    igt@kms_plane_multiple@atomic-pipe-a-tiling-y:
      shard-apl:          PASS -> FAIL (fdo#103166) +4

    igt@kms_properties@connector-properties-atomic:
      shard-glk:          NOTRUN -> FAIL (fdo#108642)
      shard-hsw:          NOTRUN -> FAIL (fdo#108642)

    igt@prime_busy@after-vebox:
      shard-glk:          NOTRUN -> DMESG-WARN (fdo#106538, fdo#105763)

    
    ==== Possible fixes ====

    igt@drv_suspend@forcewake:
      shard-kbl:          INCOMPLETE (fdo#103665) -> PASS

    igt@drv_suspend@shrink:
      shard-snb:          INCOMPLETE (fdo#106886, fdo#105411) -> PASS

    igt@gem_ppgtt@blt-vs-render-ctx0:
      shard-kbl:          INCOMPLETE (fdo#106023, fdo#103665, fdo#106887) -> PASS

    igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-b:
      shard-kbl:          DMESG-WARN (fdo#107956) -> PASS

    igt@kms_cursor_crc@cursor-128x42-sliding:
      shard-kbl:          FAIL (fdo#103232) -> PASS +3

    igt@kms_cursor_crc@cursor-256x85-random:
      shard-glk:          FAIL (fdo#103232) -> PASS +1

    igt@kms_cursor_crc@cursor-64x21-sliding:
      shard-apl:          FAIL (fdo#103232) -> PASS +3

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-pwrite:
      shard-apl:          FAIL (fdo#103167) -> PASS

    igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-onoff:
      shard-glk:          FAIL (fdo#103167) -> PASS +3

    igt@kms_plane_multiple@atomic-pipe-b-tiling-y:
      shard-apl:          FAIL (fdo#103166) -> PASS +1

    igt@kms_plane_multiple@atomic-pipe-b-tiling-yf:
      shard-kbl:          FAIL (fdo#103166) -> PASS

    igt@kms_setmode@basic:
      shard-kbl:          FAIL (fdo#99912) -> PASS

    igt@kms_universal_plane@universal-plane-pipe-a-functional:
      shard-glk:          FAIL (fdo#103166) -> PASS +3

    igt@kms_vblank@pipe-a-query-busy:
      shard-snb:          INCOMPLETE (fdo#105411) -> PASS

    igt@perf_pmu@busy-start-vcs0:
      shard-apl:          DMESG-WARN (fdo#105602, fdo#103558) -> PASS

    
    ==== Warnings ====

    igt@kms_plane_alpha_blend@pipe-c-alpha-transparant-fb:
      shard-kbl:          FAIL (fdo#108145) -> DMESG-FAIL (fdo#108145, fdo#105602, fdo#103313, fdo#103558)

fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#103232 https://bugs.freedesktop.org/show_bug.cgi?id=103232
fdo#103313 https://bugs.freedesktop.org/show_bug.cgi?id=103313
fdo#103558 https://bugs.freedesktop.org/show_bug.cgi?id=103558
fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
fdo#104782 https://bugs.freedesktop.org/show_bug.cgi?id=104782
fdo#105079 https://bugs.freedesktop.org/show_bug.cgi?id=105079
fdo#105411 https://bugs.freedesktop.org/show_bug.cgi?id=105411
fdo#105602 https://bugs.freedesktop.org/show_bug.cgi?id=105602
fdo#105682 https://bugs.freedesktop.org/show_bug.cgi?id=105682
fdo#105763 https://bugs.freedesktop.org/show_bug.cgi?id=105763
fdo#106023 https://bugs.freedesktop.org/show_bug.cgi?id=106023
fdo#106538 https://bugs.freedesktop.org/show_bug.cgi?id=106538
fdo#106886 https://bugs.freedesktop.org/show_bug.cgi?id=106886
fdo#106887 https://bugs.freedesktop.org/show_bug.cgi?id=106887
fdo#107956 https://bugs.freedesktop.org/show_bug.cgi?id=107956
fdo#108145 https://bugs.freedesktop.org/show_bug.cgi?id=108145
fdo#108147 https://bugs.freedesktop.org/show_bug.cgi?id=108147
fdo#108642 https://bugs.freedesktop.org/show_bug.cgi?id=108642
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912

== Participating hosts (6 -> 5) ==

Missing (1): shard-skl

== Build changes ==

* IGT: IGT_4714 -> IGTPW_2060

CI_DRM_5106: 852b9329fbb6ea8bdbb3dac78328aae73d919305 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2060: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2060/
IGT_4714: cab148ca3ec904a94d0cd43476cf7e1f8663f906 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2060/shards.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

Reviewed-by on v1 1/1
#3 lore raw
In reply to Paul Kocialkowski

Do you need me to push this? Or do you have push access for igt nowadays?

Quoted 47 lines · Paul Kocialkowski

The connector and EDID blob retrieved when checking for analog bridges need to be freed before returning from the associated function.

Fixes f8d6afa67 ("tests/chamelium: Detect analog bridges and handle

EDID accordingly")

---
 tests/kms_chamelium.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
tests/kms_chamelium.c +3 -1
index e0e3e3f1..55b346a9 100644
@@ -175,8 +175,10 @@ check_analog_bridge(data_t *data, struct chamelium_port
 *port)
 	unsigned char *edid;
 	char edid_vendor[3];
 
-	if (chamelium_port_get_type(port) != DRM_MODE_CONNECTOR_VGA)
+	if (chamelium_port_get_type(port) != DRM_MODE_CONNECTOR_VGA) {
+		drmModeFreeConnector(connector);
 		return false;
+	}
 
 	igt_assert(kmstest_get_property(data->drm_fd, connector->connector_id,

DRM_MODE_OBJECT_CONNECTOR, "EDID",
NULL,

tests/kms_chamelium.c +3 -3
@@ -191,14 +193,14 @@ check_analog_bridge(data_t *data, struct
 chamelium_port *port)
 			  ((edid[9] & 0xe0) >> 5)) + '@';
 	edid_vendor[2] = (edid[9] & 0x1f) + '@';
 
+	drmModeFreePropertyBlob(edid_blob);
+	drmModeFreeConnector(connector);
+
 	/* Analog bridges provide their own EDID */
 	if (edid_vendor[0] != 'I' || edid_vendor[1] != 'G' ||
 	    edid_vendor[0] != 'T')
 		return true;
 
-	drmModeFreePropertyBlob(edid_blob);
-	drmModeFreeConnector(connector);
-
 	return false;
 }
Signature · 7 lines
Cheers,
	Lyude Paul

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#4 lore raw

Hi,

Quoted 3 lines · Lyude Paul

Do you need me to push this? Or do you have push access for igt nowadays?

Sorry for the delayed answer. I don't have commit access, so feel free to push this!

Thanks,

Paul

Quoted 48 lines · Paul Kocialkowski
Quoted 47 lines

The connector and EDID blob retrieved when checking for analog bridges need to be freed before returning from the associated function.

Fixes f8d6afa67 ("tests/chamelium: Detect analog bridges and handle

EDID accordingly")

---
 tests/kms_chamelium.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
tests/kms_chamelium.c +3 -1
index e0e3e3f1..55b346a9 100644
@@ -175,8 +175,10 @@ check_analog_bridge(data_t *data, struct chamelium_port
 *port)
 	unsigned char *edid;
 	char edid_vendor[3];
 
-	if (chamelium_port_get_type(port) != DRM_MODE_CONNECTOR_VGA)
+	if (chamelium_port_get_type(port) != DRM_MODE_CONNECTOR_VGA) {
+		drmModeFreeConnector(connector);
 		return false;
+	}
 
 	igt_assert(kmstest_get_property(data->drm_fd, connector->connector_id,

DRM_MODE_OBJECT_CONNECTOR, "EDID",
NULL,

tests/kms_chamelium.c +3 -3
@@ -191,14 +193,14 @@ check_analog_bridge(data_t *data, struct
 chamelium_port *port)
 			  ((edid[9] & 0xe0) >> 5)) + '@';
 	edid_vendor[2] = (edid[9] & 0x1f) + '@';
 
+	drmModeFreePropertyBlob(edid_blob);
+	drmModeFreeConnector(connector);
+
 	/* Analog bridges provide their own EDID */
 	if (edid_vendor[0] != 'I' || edid_vendor[1] != 'G' ||
 	    edid_vendor[0] != 'T')
 		return true;
 
-	drmModeFreePropertyBlob(edid_blob);
-	drmModeFreeConnector(connector);
-
 	return false;
 }
Signature · 3 lines
Paul Kocialkowski, Bootlin (formerly Free Electrons)
Embedded Linux and kernel engineering
https://bootlin.com

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#5 lore raw
In reply to Lyude Paul

Pushed, thanks!

Also, welcome back :)

Quoted 53 lines · Lyude Paul

Do you need me to push this? Or do you have push access for igt nowadays?

Quoted 48 lines · Paul Kocialkowski

The connector and EDID blob retrieved when checking for analog bridges need to be freed before returning from the associated function.

Fixes f8d6afa67 ("tests/chamelium: Detect analog bridges and handle

EDID accordingly")

---
 tests/kms_chamelium.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
tests/kms_chamelium.c +0 -0
index e0e3e3f1..55b346a9 100644
@@ -175,8 +175,10 @@ check_analog_bridge(data_t *data, struct

chamelium_port
*port)

tests/kms_chamelium.c +3 -1
 	unsigned char *edid;
 	char edid_vendor[3];
 
-	if (chamelium_port_get_type(port) != DRM_MODE_CONNECTOR_VGA)
+	if (chamelium_port_get_type(port) != DRM_MODE_CONNECTOR_VGA) {
+		drmModeFreeConnector(connector);
 		return false;
+	}
 
 	igt_assert(kmstest_get_property(data->drm_fd, connector->connector_id,
 					DRM_MODE_OBJECT_CONNECTOR, "EDID",

NULL,

tests/kms_chamelium.c +3 -3
@@ -191,14 +193,14 @@ check_analog_bridge(data_t *data, struct
 chamelium_port *port)
 			  ((edid[9] & 0xe0) >> 5)) + '@';
 	edid_vendor[2] = (edid[9] & 0x1f) + '@';
 
+	drmModeFreePropertyBlob(edid_blob);
+	drmModeFreeConnector(connector);
+
 	/* Analog bridges provide their own EDID */
 	if (edid_vendor[0] != 'I' || edid_vendor[1] != 'G' ||
 	    edid_vendor[0] != 'T')
 		return true;
 
-	drmModeFreePropertyBlob(edid_blob);
-	drmModeFreeConnector(connector);
-
 	return false;
 }
Signature · 7 lines
Cheers,
	Lyude Paul

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev