diff options
author | Navid Emamdoost <navid.emamdoost@gmail.com> | 2019-09-25 06:30:30 +0200 |
---|---|---|
committer | james qian wang (Arm Technology China) <james.qian.wang@arm.com> | 2019-09-27 10:10:58 +0200 |
commit | a0ecd6fdbf5d648123a7315c695fb6850d702835 (patch) | |
tree | 1185e1b1d1a39905b463d3e80745d35d8572d3ee /drivers/gpu | |
parent | drm: Clear the fence pointer when writeback job signaled (diff) | |
download | linux-a0ecd6fdbf5d648123a7315c695fb6850d702835.tar.xz linux-a0ecd6fdbf5d648123a7315c695fb6850d702835.zip |
drm/komeda: prevent memory leak in komeda_wb_connector_add
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>
Reviewed-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com>
Signed-off-by: james qian wang (Arm Technology China) <james.qian.wang@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190925043031.32308-1-navid.emamdoost@gmail.com
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c | 4 |
1 files changed, 3 insertions, 1 deletions
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 23fbee268119..b72840c06ab7 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c @@ -165,8 +165,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; + } drm_connector_helper_add(&wb_conn->base, &komeda_wb_conn_helper_funcs); |