[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20170921112443.GH4914@intel.com>
Date: Thu, 21 Sep 2017 14:24:43 +0300
From: Ville Syrjälä <ville.syrjala@...ux.intel.com>
To: Arvind Yadav <arvind.yadav.cs@...il.com>
Cc: thierry.reding@...il.com, airlied@...ux.ie, jonathanh@...dia.com,
daniel.vetter@...el.com, jani.nikula@...ux.intel.com,
seanpaul@...omium.org, linux-kernel@...r.kernel.org,
dri-devel@...ts.freedesktop.org
Subject: Re: [PATCH 2/2] drm: Release memory obtained by kasprintf
On Wed, Sep 20, 2017 at 12:55:08PM +0530, Arvind Yadav wrote:
> Free memory region, if drm_crtc_init_with_planes is not successful.
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@...il.com>
> ---
> drivers/gpu/drm/drm_crtc.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index 5af25ce..cd4e628 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -328,6 +328,7 @@ int drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc,
> ret = drm_crtc_crc_init(crtc);
> if (ret) {
> drm_mode_object_unregister(dev, &crtc->base);
> + kfree(crtc->name);
Looks correct. However my ocd would wish the kfree() to precede
drm_mode_object_unregister() to make the unwinding mirror the
allocation/registration sequence.
> return ret;
> }
>
> --
> 1.9.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@...ts.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Ville Syrjälä
Intel OTC
Powered by blists - more mailing lists