summaryrefslogtreecommitdiff
path: root/linux-core/drm_stub.c
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@hobbes.virtuousgeek.org>2007-04-17 10:14:18 -0700
committerJesse Barnes <jbarnes@hobbes.virtuousgeek.org>2007-04-17 10:14:18 -0700
commit1c7f895fa6531b16e7e9fd4568d4f6a50ca5711e (patch)
treeb46163c3b5f98e18d3ad1c70c095d77fc71721e6 /linux-core/drm_stub.c
parent4e4d9cbeb3f52b605e46aad8ae1a947ca236079f (diff)
parentb729b919baed250313caf3f0bbd4044e084de8bf (diff)
Merge branch 'modesetting-101' of git+ssh://git.freedesktop.org/git/mesa/drm into origin/modesetting-101
Conflicts: shared-core/i915_init.c - reconcile with airlied's new code
Diffstat (limited to 'linux-core/drm_stub.c')
-rw-r--r--linux-core/drm_stub.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/linux-core/drm_stub.c b/linux-core/drm_stub.c
index 417e5095..01ffe679 100644
--- a/linux-core/drm_stub.c
+++ b/linux-core/drm_stub.c
@@ -79,27 +79,28 @@ static int drm_fill_in_dev(drm_device_t * dev, struct pci_dev *pdev,
#endif
dev->irq = pdev->irq;
- if (drm_ht_create(&dev->map_hash, DRM_MAP_HASH_ORDER)) {
- drm_free(dev->maplist, sizeof(*dev->maplist), DRM_MEM_MAPS);
+ if (drm_ht_create(&dev->map_hash, DRM_MAP_HASH_ORDER))
return -ENOMEM;
- }
+
if (drm_mm_init(&dev->offset_manager, DRM_FILE_PAGE_OFFSET_START,
DRM_FILE_PAGE_OFFSET_SIZE)) {
- drm_free(dev->maplist, sizeof(*dev->maplist), DRM_MEM_MAPS);
drm_ht_remove(&dev->map_hash);
return -ENOMEM;
}
if (drm_ht_create(&dev->object_hash, DRM_OBJECT_HASH_ORDER)) {
- drm_free(dev->maplist, sizeof(*dev->maplist), DRM_MEM_MAPS);
drm_ht_remove(&dev->map_hash);
drm_mm_takedown(&dev->offset_manager);
return -ENOMEM;
}
dev->maplist = drm_calloc(1, sizeof(*dev->maplist), DRM_MEM_MAPS);
- if (dev->maplist == NULL)
+ if (dev->maplist == NULL) {
+ drm_ht_remove(&dev->object_hash);
+ drm_ht_remove(&dev->map_hash);
+ drm_mm_takedown(&dev->offset_manager);
return -ENOMEM;
+ }
INIT_LIST_HEAD(&dev->maplist->head);
/* the DRM has 6 counters */