]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drm/i915: Don't leak VBT mode data
authorMatt Roper <matthew.d.roper@intel.com>
Tue, 15 Sep 2015 02:24:18 +0000 (19:24 -0700)
committerJani Nikula <jani.nikula@intel.com>
Fri, 18 Sep 2015 11:20:28 +0000 (14:20 +0300)
We allocate memory for LVDS modes while parsing the VBT at startup, but
never free this memory when the driver is unloaded, causing a small
leak.

Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/i915_dma.c

index 066a0efa75d72a03ef4f645fc4734cb91c432f5a..c0695504dd8fa35e9bd793d31f85c9404b0f2db7 100644 (file)
@@ -1137,6 +1137,10 @@ int i915_driver_unload(struct drm_device *dev)
                dev_priv->vbt.child_dev = NULL;
                dev_priv->vbt.child_dev_num = 0;
        }
+       kfree(dev_priv->vbt.sdvo_lvds_vbt_mode);
+       dev_priv->vbt.sdvo_lvds_vbt_mode = NULL;
+       kfree(dev_priv->vbt.lfp_lvds_vbt_mode);
+       dev_priv->vbt.lfp_lvds_vbt_mode = NULL;
 
        vga_switcheroo_unregister_client(dev->pdev);
        vga_client_register(dev->pdev, NULL, NULL, NULL);