Commit a0ecd6fd authored by Navid Emamdoost's avatar Navid Emamdoost Committed by james qian wang (Arm Technology China)

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: default avatarNavid Emamdoost <navid.emamdoost@gmail.com>
Reviewed-by: default avatarJames Qian Wang (Arm Technology China) <james.qian.wang@arm.com>
Signed-off-by: default avatarjames qian wang (Arm Technology China) <james.qian.wang@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190925043031.32308-1-navid.emamdoost@gmail.com
parent b1066a12
...@@ -165,8 +165,10 @@ static int komeda_wb_connector_add(struct komeda_kms_dev *kms, ...@@ -165,8 +165,10 @@ static int komeda_wb_connector_add(struct komeda_kms_dev *kms,
&komeda_wb_encoder_helper_funcs, &komeda_wb_encoder_helper_funcs,
formats, n_formats); formats, n_formats);
komeda_put_fourcc_list(formats); komeda_put_fourcc_list(formats);
if (err) if (err) {
kfree(kwb_conn);
return err; return err;
}
drm_connector_helper_add(&wb_conn->base, &komeda_wb_conn_helper_funcs); drm_connector_helper_add(&wb_conn->base, &komeda_wb_conn_helper_funcs);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment