Add error checking to framebuffer creation

Make the Intel routine return an error if needed and make the core check for
it.
main
Jesse Barnes 2008-08-12 18:23:58 -07:00
parent e9648e9107
commit 085df6491e
2 changed files with 6 additions and 2 deletions

View File

@ -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++;

View File

@ -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) {