From: Lyude Paul <lyude@redhat.com>
To: Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t] chamelium: Fix analog bridge detection memory leak
Date: Tue, 20 Nov 2018 20:44:34 -0500 [thread overview]
Message-ID: <21027818b010f3322de3717cd0c653079cb279f9.camel@redhat.com> (raw)
In-Reply-To: <20181114152918.14692-1-paul.kocialkowski@bootlin.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Do you need me to push this? Or do you have push access for igt nowadays?
On Wed, 2018-11-14 at 16:29 +0100, Paul Kocialkowski wrote:
> 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")
> Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
> ---
> tests/kms_chamelium.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/tests/kms_chamelium.c b/tests/kms_chamelium.c
> index e0e3e3f1..55b346a9 100644
> --- a/tests/kms_chamelium.c
> +++ b/tests/kms_chamelium.c
> @@ -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;
> }
>
--
Cheers,
Lyude Paul
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2018-11-21 1:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-14 15:29 [igt-dev] [PATCH i-g-t] chamelium: Fix analog bridge detection memory leak Paul Kocialkowski
2018-11-14 16:12 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2018-11-15 3:04 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2018-11-21 1:44 ` Lyude Paul [this message]
2018-11-30 14:02 ` [igt-dev] [PATCH i-g-t] " Paul Kocialkowski
2018-12-04 0:54 ` Lyude Paul
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=21027818b010f3322de3717cd0c653079cb279f9.camel@redhat.com \
--to=lyude@redhat.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=paul.kocialkowski@bootlin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox