summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_pci.c
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2013-10-02 11:23:37 +0200
committerDave Airlie <airlied@redhat.com>2013-10-09 07:55:09 +0200
commit0dc8fe5985e01f238e7dc64ff1733cc0291811e8 (patch)
tree977b912c062fee10c10e39082546a5ecacd39792 /drivers/gpu/drm/drm_pci.c
parentdrm: move drm_lastclose() to drm_fops.c (diff)
downloadlinux-0dc8fe5985e01f238e7dc64ff1733cc0291811e8.tar.xz
linux-0dc8fe5985e01f238e7dc64ff1733cc0291811e8.zip
drm: introduce drm_dev_free() to fix error paths
The error paths in DRM bus drivers currently leak memory as they don't correctly revert drm_dev_alloc(). Introduce drm_dev_free() to free DRM devices which haven't been registered, yet. We must be careful not to introduce any side-effects with cleanups done in drm_dev_free(). drm_ht_remove(), drm_ctxbitmap_cleanup() and drm_gem_destroy() are all fine in that regard. Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_pci.c')
-rw-r--r--drivers/gpu/drm/drm_pci.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
index 743589dc47ce..cabe2bd702ae 100644
--- a/drivers/gpu/drm/drm_pci.c
+++ b/drivers/gpu/drm/drm_pci.c
@@ -354,7 +354,7 @@ int drm_get_pci_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
err_pci:
pci_disable_device(pdev);
err_free:
- kfree(dev);
+ drm_dev_free(dev);
return ret;
}
EXPORT_SYMBOL(drm_get_pci_dev);