projects
/
profile
/
ivi
/
libdrm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f1b9bbe
)
free dummy read page if fail to init mm
author
Hong Liu
<hong.liu@intel.com>
Fri, 9 May 2008 02:15:17 +0000
(10:15 +0800)
committer
Jesse Barnes
<jbarnes@nietzche.virtuousgeek.org>
Mon, 12 May 2008 19:07:27 +0000
(12:07 -0700)
Since drm_bo_driver_init will be called in driver_load, we need to free
what it alloced when error to avoid memory leak.
linux-core/drm_bo.c
patch
|
blob
|
history
diff --git
a/linux-core/drm_bo.c
b/linux-core/drm_bo.c
index
301f946
..
0470825
100644
(file)
--- a/
linux-core/drm_bo.c
+++ b/
linux-core/drm_bo.c
@@
-2406,8
+2406,14
@@
int drm_bo_driver_init(struct drm_device *dev)
* Other types need to be driver / IOCTL initialized.
*/
ret = drm_bo_init_mm(dev, DRM_BO_MEM_LOCAL, 0, 0, 1);
- if (ret)
+ if (ret) {
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15))
+ ClearPageReserved(bm->dummy_read_page);
+#endif
+ __free_page(bm->dummy_read_page);
+ bm->dummy_read_page = NULL;
goto out_unlock;
+ }
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
INIT_WORK(&bm->wq, &drm_bo_delayed_workqueue, dev);