drm drm_fb_helper: destroy modes
authorSascha Hauer <s.hauer@pengutronix.de>
Wed, 1 Feb 2012 10:38:22 +0000 (11:38 +0100)
committerDave Airlie <airlied@redhat.com>
Fri, 3 Feb 2012 09:51:13 +0000 (09:51 +0000)
drm_setup_crtcs allocated modes using drm_mode_duplicate. Free
them in drm_fb_helper_crtc_free.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_fb_helper.c

index aada26f63decc7a91d2803079dc9795d053ecdc2..77fec5a9383278a4190605d323a45c0b36921e11 100644 (file)
@@ -430,8 +430,11 @@ static void drm_fb_helper_crtc_free(struct drm_fb_helper *helper)
        for (i = 0; i < helper->connector_count; i++)
                kfree(helper->connector_info[i]);
        kfree(helper->connector_info);
-       for (i = 0; i < helper->crtc_count; i++)
+       for (i = 0; i < helper->crtc_count; i++) {
                kfree(helper->crtc_info[i].mode_set.connectors);
+               if (helper->crtc_info[i].mode_set.mode)
+                       drm_mode_destroy(helper->dev, helper->crtc_info[i].mode_set.mode);
+       }
        kfree(helper->crtc_info);
 }