summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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) {