From: Jani Nikula Date: Mon, 12 Nov 2012 16:31:36 +0000 (+0200) Subject: drm/i915/sdvo: kfree the intel_sdvo_connector, not drm_connector, on destroy X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4b745b1e54efa5154a06ed606ad82660773602b3;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git drm/i915/sdvo: kfree the intel_sdvo_connector, not drm_connector, on destroy Since the base fields in both struct intel_connector and struct intel_sdvo_connector are at the beginning of the enclosing struct, the pointers are essentially the same, but there is no requirement or guarantee that this is always the case. Kfree the enclosing intel_sdvo_connector pointer that was originally allocated, not the enclosed drm_connector, in case someone ever rearranges the structs. Signed-off-by: Jani Nikula Signed-off-by: Daniel Vetter --- diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c index d85ebb0a83e9..a4bee83df745 100644 --- a/drivers/gpu/drm/i915/intel_sdvo.c +++ b/drivers/gpu/drm/i915/intel_sdvo.c @@ -1832,7 +1832,7 @@ static void intel_sdvo_destroy(struct drm_connector *connector) intel_sdvo_destroy_enhance_property(connector); drm_sysfs_connector_remove(connector); drm_connector_cleanup(connector); - kfree(connector); + kfree(intel_sdvo_connector); } static bool intel_sdvo_detect_hdmi_audio(struct drm_connector *connector)