lkml.org 
[lkml]   [2019]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: drm/komeda: prevent memory leak in komeda_wb_connector_add
Date
On Tue, Sep 24, 2019 at 11:30:30PM -0500, Navid Emamdoost wrote:
> In komeda_wb_connector_add if drm_writeback_connector_init fails the
> allocated memory for kwb_conn should be released.
>
> Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
> ---
> drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c
> index 2851cac94d86..75133f967fdb 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c
> @@ -166,8 +166,10 @@ static int komeda_wb_connector_add(struct komeda_kms_dev *kms,
> &komeda_wb_encoder_helper_funcs,
> formats, n_formats);
> komeda_put_fourcc_list(formats);
> - if (err)
> + if (err) {
> + kfree(kwb_conn);
> return err;
> + }

Thank you for the fix.

Will push it to drm-misc-fixes

Reviewed-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com>

>
> drm_connector_helper_add(&wb_conn->base, &komeda_wb_conn_helper_funcs);
>

\
 
 \ /
  Last update: 2019-09-27 10:10    [W:0.044 / U:3.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site