summaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@virtuousgeek.org>2008-08-12 18:23:58 -0700
committerJesse Barnes <jbarnes@virtuousgeek.org>2008-08-12 18:23:58 -0700
commit085df6491e4975681a6e17ff9a67d01268aa7553 (patch)
tree87dbac86832754b7409cf0525b3b5e52b024b5dc /linux-core
parente9648e9107e90c3ef38a9c9ebb95bac1297d0df5 (diff)
Add error checking to framebuffer creation
Make the Intel routine return an error if needed and make the core check for it.
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/drm_crtc.c4
-rw-r--r--linux-core/intel_display.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/linux-core/drm_crtc.c b/linux-core/drm_crtc.c
index 8375bf9a..aa6749d6 100644
--- a/linux-core/drm_crtc.c
+++ b/linux-core/drm_crtc.c
@@ -285,7 +285,9 @@ struct drm_crtc *drm_crtc_from_fb(struct drm_device *dev,
struct drm_framebuffer *drm_framebuffer_init(struct drm_device *dev, struct drm_framebuffer *fb,
const struct drm_framebuffer_funcs *funcs)
{
- drm_mode_object_get(dev, &fb->base, DRM_MODE_OBJECT_FB);
+ if(drm_mode_object_get(dev, &fb->base, DRM_MODE_OBJECT_FB))
+ return NULL;
+
fb->dev = dev;
fb->funcs = funcs;
dev->mode_config.num_fb++;
diff --git a/linux-core/intel_display.c b/linux-core/intel_display.c
index 0236bbc9..fbe06f7c 100644
--- a/linux-core/intel_display.c
+++ b/linux-core/intel_display.c
@@ -1506,7 +1506,9 @@ struct drm_framebuffer *intel_user_framebuffer_create(struct drm_device *dev,
if (!intel_fb)
return NULL;
- drm_framebuffer_init(dev, &intel_fb->base, &intel_fb_funcs);
+ if (!drm_framebuffer_init(dev, &intel_fb->base, &intel_fb_funcs))
+ return NULL;
+
drm_helper_mode_fill_fb_struct(&intel_fb->base, mode_cmd);
if (filp) {