Commit 02036cee authored by Imre Deak's avatar Imre Deak

drm/i915: Sanitize i915_get_bridge_dev() error path

Clarify the name of the label on the error path, making it clear what's
being cleaned up. The kmem_cache_destroy() calls are NOPs on the
corresponding error path.
Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
Reviewed-by: default avatarDavid Weinehall <david.weinehall@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1453209992-25995-3-git-send-email-imre.deak@intel.com
parent 89250fec
...@@ -916,7 +916,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) ...@@ -916,7 +916,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
if (i915_get_bridge_dev(dev)) { if (i915_get_bridge_dev(dev)) {
ret = -EIO; ret = -EIO;
goto free_priv; goto out_runtime_pm_put;
} }
mmio_bar = IS_GEN2(dev) ? 1 : 0; mmio_bar = IS_GEN2(dev) ? 1 : 0;
...@@ -1121,11 +1121,10 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) ...@@ -1121,11 +1121,10 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
pci_iounmap(dev->pdev, dev_priv->regs); pci_iounmap(dev->pdev, dev_priv->regs);
put_bridge: put_bridge:
pci_dev_put(dev_priv->bridge_dev); pci_dev_put(dev_priv->bridge_dev);
free_priv:
kmem_cache_destroy(dev_priv->requests); kmem_cache_destroy(dev_priv->requests);
kmem_cache_destroy(dev_priv->vmas); kmem_cache_destroy(dev_priv->vmas);
kmem_cache_destroy(dev_priv->objects); kmem_cache_destroy(dev_priv->objects);
out_runtime_pm_put:
intel_runtime_pm_put(dev_priv); intel_runtime_pm_put(dev_priv);
kfree(dev_priv); kfree(dev_priv);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment