intel_sdvo_connector_funcs registers intel_connector_destroy() as the .destroy callback. Once drm_connector_init_with_ddc() succeeds inside intel_sdvo_connector_init(), the DRM core takes ownership of the connector object and will call .destroy on teardown.
The error labels in intel_sdvo_tv_init() and intel_sdvo_lvds_init() call intel_connector_destroy() explicitly before returning false, causing it to be invoked twice: once in the error path and again by the DRM core through the registered .destroy callback. Remove the manual intel_connector_destroy() calls from the error labels and return false directly instead. Cc: [email protected] Fixes: 32aad86fe88e7 ("drm/i915/sdvo: Propagate errors from reading/writing control bus.") Signed-off-by: Kory Maincent <[email protected]> --- Not tested as I don't have such hardware. --- drivers/gpu/drm/i915/display/intel_sdvo.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_sdvo.c b/drivers/gpu/drm/i915/display/intel_sdvo.c index d83d350959d88..0f3aa879e39e1 100644 --- a/drivers/gpu/drm/i915/display/intel_sdvo.c +++ b/drivers/gpu/drm/i915/display/intel_sdvo.c @@ -2878,16 +2878,12 @@ intel_sdvo_tv_init(struct intel_sdvo *intel_sdvo, u16 type) } if (!intel_sdvo_tv_create_property(intel_sdvo, intel_sdvo_connector, type)) - goto err; + return false; if (!intel_sdvo_create_enhance_property(intel_sdvo, intel_sdvo_connector)) - goto err; + return false; return true; - -err: - intel_connector_destroy(connector); - return false; } static bool @@ -2950,7 +2946,7 @@ intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, u16 type) } if (!intel_sdvo_create_enhance_property(intel_sdvo, intel_sdvo_connector)) - goto err; + return false; intel_bios_init_panel_late(display, &intel_connector->panel, NULL, NULL); @@ -2972,13 +2968,9 @@ intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, u16 type) intel_panel_init(intel_connector, NULL); if (!intel_panel_preferred_fixed_mode(intel_connector)) - goto err; + return false; return true; - -err: - intel_connector_destroy(connector); - return false; } static u16 intel_sdvo_filter_output_flags(u16 flags) -- 2.43.0
