drm/i915/sdvo: Cleanup connector on error path
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 23 Sep 2010 15:15:21 +0000 (16:15 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 23 Sep 2010 16:13:33 +0000 (17:13 +0100)
We weren't unlinking the freed connector from the drm lists, and so
hit some use-after-free if we failed to initialise the connector.

Reported-and-tested-by: Woody Suwalski <terraluna977@gmail.com>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=18342
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
drivers/gpu/drm/i915/intel_sdvo.c

index e8e902d614edc8431cd4f17b5650a4682c7b0917..60fcef700be6630450f5f8fe66fcf3df82333bf9 100644 (file)
@@ -2170,8 +2170,7 @@ intel_sdvo_tv_init(struct intel_sdvo *intel_sdvo, int type)
         return true;
 
 err:
-       intel_sdvo_destroy_enhance_property(connector);
-       kfree(intel_sdvo_connector);
+       intel_sdvo_destroy(connector);
        return false;
 }
 
@@ -2243,8 +2242,7 @@ intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, int device)
        return true;
 
 err:
-       intel_sdvo_destroy_enhance_property(connector);
-       kfree(intel_sdvo_connector);
+       intel_sdvo_destroy(connector);
        return false;
 }