Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 155541
b: refs/heads/master
c: 845792d
h: refs/heads/master
i:
  155539: 46428af
v: v3
  • Loading branch information
Jiri Slaby authored and Dave Airlie committed Jul 15, 2009
1 parent 00923ac commit 90cb625
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d25e3a6faa82eeaa6e5487c2d2e27cfd938ed108
refs/heads/master: 845792d940f5755b7a7837c450a71d9e831a13e2
17 changes: 10 additions & 7 deletions trunk/drivers/gpu/drm/drm_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,26 +134,29 @@ drm_gem_object_alloc(struct drm_device *dev, size_t size)
BUG_ON((size & (PAGE_SIZE - 1)) != 0);

obj = kzalloc(sizeof(*obj), GFP_KERNEL);
if (!obj)
goto free;

obj->dev = dev;
obj->filp = shmem_file_setup("drm mm object", size, VM_NORESERVE);
if (IS_ERR(obj->filp)) {
kfree(obj);
return NULL;
}
if (IS_ERR(obj->filp))
goto free;

kref_init(&obj->refcount);
kref_init(&obj->handlecount);
obj->size = size;
if (dev->driver->gem_init_object != NULL &&
dev->driver->gem_init_object(obj) != 0) {
fput(obj->filp);
kfree(obj);
return NULL;
goto fput;
}
atomic_inc(&dev->object_count);
atomic_add(obj->size, &dev->object_memory);
return obj;
fput:
fput(obj->filp);
free:
kfree(obj);
return NULL;
}
EXPORT_SYMBOL(drm_gem_object_alloc);

Expand Down

0 comments on commit 90cb625

Please sign in to comment.