aboutsummaryrefslogtreecommitdiff
path: root/linux-core/drm_bo.c
diff options
context:
space:
mode:
authorHong Liu <hong.liu@intel.com>2008-05-19 17:06:40 +0800
committerJesse Barnes <jbarnes@virtuousgeek.org>2008-05-22 10:35:55 -0700
commit1cde3cc1ac467eb0527ed55127cf3bb983afde80 (patch)
tree9072c0d22fe36a0a79308c6a7a7f9dfcae6f626b /linux-core/drm_bo.c
parente8320a716d97504d91299d20d640b847c86e4b17 (diff)
i915: check dummy page before freeing
The dummy read page will point to NULL if drm_bo_driver_init failed at firstopen (modeset is not enabled), and will cause kernel oops at subsequent drm_lastclose call, so be sure to check it.
Diffstat (limited to 'linux-core/drm_bo.c')
-rw-r--r--linux-core/drm_bo.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/linux-core/drm_bo.c b/linux-core/drm_bo.c
index 0470825b..f2d3cebf 100644
--- a/linux-core/drm_bo.c
+++ b/linux-core/drm_bo.c
@@ -2361,10 +2361,12 @@ int drm_bo_driver_finish(struct drm_device *dev)
if (list_empty(&bm->unfenced))
DRM_DEBUG("Unfenced list was clean\n");
+ if (bm->dummy_read_page) {
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15))
- ClearPageReserved(bm->dummy_read_page);
+ ClearPageReserved(bm->dummy_read_page);
#endif
- __free_page(bm->dummy_read_page);
+ __free_page(bm->dummy_read_page);
+ }
out:
mutex_unlock(&dev->struct_mutex);