Skip to content

Commit

Permalink
drm: Return -ENOENT when a framebuffer can't be found
Browse files Browse the repository at this point in the history
Return -ENOENT for framebuffers like we do for other mode objects that
can't be found.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Ville Syrjälä authored and Dave Airlie committed Nov 6, 2013
1 parent f27657f commit 37c4e70
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions drivers/gpu/drm/drm_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2164,7 +2164,7 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data,
if (!fb) {
DRM_DEBUG_KMS("Unknown FB ID%d\n",
crtc_req->fb_id);
ret = -EINVAL;
ret = -ENOENT;
goto out;
}
}
Expand Down Expand Up @@ -2654,7 +2654,7 @@ int drm_mode_rmfb(struct drm_device *dev,
mutex_unlock(&dev->mode_config.fb_lock);
mutex_unlock(&file_priv->fbs_lock);

return -EINVAL;
return -ENOENT;
}

/**
Expand Down Expand Up @@ -2682,7 +2682,7 @@ int drm_mode_getfb(struct drm_device *dev,

fb = drm_framebuffer_lookup(dev, r->fb_id);
if (!fb)
return -EINVAL;
return -ENOENT;

r->height = fb->height;
r->width = fb->width;
Expand Down Expand Up @@ -2727,7 +2727,7 @@ int drm_mode_dirtyfb_ioctl(struct drm_device *dev,

fb = drm_framebuffer_lookup(dev, r->fb_id);
if (!fb)
return -EINVAL;
return -ENOENT;

num_clips = r->num_clips;
clips_ptr = (struct drm_clip_rect __user *)(unsigned long)r->clips_ptr;
Expand Down Expand Up @@ -3636,8 +3636,10 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
goto out;

fb = drm_framebuffer_lookup(dev, page_flip->fb_id);
if (!fb)
if (!fb) {
ret = -ENOENT;
goto out;
}

ret = drm_crtc_check_viewport(crtc, crtc->x, crtc->y, &crtc->mode, fb);
if (ret)
Expand Down

0 comments on commit 37c4e70

Please sign in to comment.