drm/tilcdc: panel: fix leak when unloading the module
authorGuido Martínez <guido@vanguardiasur.com.ar>
Tue, 17 Jun 2014 14:17:07 +0000 (11:17 -0300)
committerDave Airlie <airlied@redhat.com>
Tue, 8 Jul 2014 01:25:14 +0000 (11:25 +1000)
The driver did not unregister the allocated framebuffer, which caused
memory leaks (and memory manager WARNs) when unloading. Also, the
framebuffer device under /dev still existed after unloading.

Add a call to drm_fbdev_cma_fini when unloading the module to prevent
both issues.

Signed-off-by: Guido Martínez <guido@vanguardiasur.com.ar>
Tested-by: Darren Etheridge <detheridge@ti.com>
Cc: <stable@vger.kernel.org> #v3.9+
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/tilcdc/tilcdc_drv.c

index b20b69488dc9b28d66e557578fa9ab1680984c3b..490aee79e1065e2cb98fdba079e4a8bc70f40eb5 100644 (file)
@@ -122,6 +122,7 @@ static int tilcdc_unload(struct drm_device *dev)
        struct tilcdc_drm_private *priv = dev->dev_private;
        struct tilcdc_module *mod, *cur;
 
+       drm_fbdev_cma_fini(priv->fbdev);
        drm_kms_helper_poll_fini(dev);
        drm_mode_config_cleanup(dev);
        drm_vblank_cleanup(dev);