intel_encoder->cloneable = false;
intel_encoder->hot_plug = intel_ddi_hot_plug;
- if (!intel_dp_init_connector(intel_dig_port, dp_connector))
+ if (!intel_dp_init_connector(intel_dig_port, dp_connector)) {
+ kfree(dp_connector);
return;
+ }
if (intel_encoder->type != INTEL_OUTPUT_EDP) {
hdmi_connector = kzalloc(sizeof(struct intel_connector),
/* if this fails, presume the device is a ghost */
DRM_INFO("failed to retrieve link info, disabling eDP\n");
intel_dp_encoder_destroy(&intel_dig_port->base.base);
- intel_dp_destroy(connector);
return false;
}
intel_dp_i2c_init(intel_dp, intel_connector, name);
- if (!intel_edp_init_connector(intel_dp, intel_connector))
+ if (!intel_edp_init_connector(intel_dp, intel_connector)) {
+ drm_sysfs_connector_remove(connector);
+ drm_connector_cleanup(connector);
return false;
+ }
intel_dp_add_properties(intel_dp, connector);
intel_encoder->cloneable = false;
intel_encoder->hot_plug = intel_dp_hot_plug;
- intel_dp_init_connector(intel_dig_port, intel_connector);
+ if (!intel_dp_init_connector(intel_dig_port, intel_connector))
+ kfree(intel_connector);
}