lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <f42752b8814bf02ed33dbd597d60fa8e07070bfb.camel@pengutronix.de>
Date:   Tue, 29 Mar 2022 18:41:02 +0200
From:   Philipp Zabel <p.zabel@...gutronix.de>
To:     José Expósito <jose.exposito89@...il.com>,
        LW@...o-electronics.de
Cc:     airlied@...ux.ie, daniel@...ll.ch, shawnguo@...nel.org,
        s.hauer@...gutronix.de, kernel@...gutronix.de, festevam@...il.com,
        linux-imx@....com, dri-devel@...ts.freedesktop.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] drm/imx: Fix memory leak in
 imx_pd_connector_get_modes

On Sa, 2022-01-08 at 17:52 +0100, José Expósito wrote:
> Avoid leaking the display mode variable if of_get_drm_display_mode
> fails.
> 
> Fixes: 76ecd9c9fb24 ("drm/imx: parallel-display: check return code
> from of_get_drm_display_mode()")
> Addresses-Coverity-ID: 1443943 ("Resource leak")
> Signed-off-by: José Expósito <jose.exposito89@...il.com>
> 
> ---
> 
> v2: Improve commit message
> ---
>  drivers/gpu/drm/imx/parallel-display.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/imx/parallel-display.c
> b/drivers/gpu/drm/imx/parallel-display.c
> index a8aba0141ce7..3bf8e0a4803a 100644
> --- a/drivers/gpu/drm/imx/parallel-display.c
> +++ b/drivers/gpu/drm/imx/parallel-display.c
> @@ -75,8 +75,10 @@ static int imx_pd_connector_get_modes(struct
> drm_connector *connector)
>                 ret = of_get_drm_display_mode(np, &imxpd->mode,
>                                               &imxpd->bus_flags,
>                                               OF_USE_NATIVE_MODE);
> -               if (ret)
> +               if (ret) {
> +                       drm_mode_destroy(connector->dev, mode);
>                         return ret;
> +               }
>  
>                 drm_mode_copy(mode, &imxpd->mode);
>                 mode->type |= DRM_MODE_TYPE_DRIVER |
> DRM_MODE_TYPE_PREFERRED;

Thank you, applied to imx-drm/fixes.

regards
Philipp

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ