Commit 770ba238 authored by Jesse Barnes's avatar Jesse Barnes Committed by Ben Hutchings

drm: remove some potentially dangerous DRM_ERRORs

commit acb4b992 upstream.

Each of these error messages can be caused by a broken or malicious
userspace wanting to spam the dmesg with useless info.  They're really
not worthy of DRM_DEBUG statements either; those are generally only
useful during bringup of new hardware or versions, and ought to be
removed before going upstream anyway.
Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: default avatarAlex Deucher <alexdeucher@gmail.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
[bwh: Backported to 3.2: s/r\./r->/ in drm_mode_addfb()]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent c09ccfb9
...@@ -1625,10 +1625,8 @@ int drm_mode_cursor_ioctl(struct drm_device *dev, ...@@ -1625,10 +1625,8 @@ int drm_mode_cursor_ioctl(struct drm_device *dev,
if (!drm_core_check_feature(dev, DRIVER_MODESET)) if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL; return -EINVAL;
if (!req->flags) { if (!req->flags)
DRM_ERROR("no operation set\n");
return -EINVAL; return -EINVAL;
}
mutex_lock(&dev->mode_config.mutex); mutex_lock(&dev->mode_config.mutex);
obj = drm_mode_object_find(dev, req->crtc_id, DRM_MODE_OBJECT_CRTC); obj = drm_mode_object_find(dev, req->crtc_id, DRM_MODE_OBJECT_CRTC);
...@@ -1641,7 +1639,6 @@ int drm_mode_cursor_ioctl(struct drm_device *dev, ...@@ -1641,7 +1639,6 @@ int drm_mode_cursor_ioctl(struct drm_device *dev,
if (req->flags & DRM_MODE_CURSOR_BO) { if (req->flags & DRM_MODE_CURSOR_BO) {
if (!crtc->funcs->cursor_set) { if (!crtc->funcs->cursor_set) {
DRM_ERROR("crtc does not support cursor\n");
ret = -ENXIO; ret = -ENXIO;
goto out; goto out;
} }
...@@ -1654,7 +1651,6 @@ int drm_mode_cursor_ioctl(struct drm_device *dev, ...@@ -1654,7 +1651,6 @@ int drm_mode_cursor_ioctl(struct drm_device *dev,
if (crtc->funcs->cursor_move) { if (crtc->funcs->cursor_move) {
ret = crtc->funcs->cursor_move(crtc, req->x, req->y); ret = crtc->funcs->cursor_move(crtc, req->x, req->y);
} else { } else {
DRM_ERROR("crtc does not support cursor\n");
ret = -EFAULT; ret = -EFAULT;
goto out; goto out;
} }
...@@ -1692,14 +1688,11 @@ int drm_mode_addfb(struct drm_device *dev, ...@@ -1692,14 +1688,11 @@ int drm_mode_addfb(struct drm_device *dev,
if (!drm_core_check_feature(dev, DRIVER_MODESET)) if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL; return -EINVAL;
if ((config->min_width > r->width) || (r->width > config->max_width)) { if ((config->min_width > r->width) || (r->width > config->max_width))
DRM_ERROR("mode new framebuffer width not within limits\n");
return -EINVAL; return -EINVAL;
}
if ((config->min_height > r->height) || (r->height > config->max_height)) { if ((config->min_height > r->height) || (r->height > config->max_height))
DRM_ERROR("mode new framebuffer height not within limits\n");
return -EINVAL; return -EINVAL;
}
mutex_lock(&dev->mode_config.mutex); mutex_lock(&dev->mode_config.mutex);
...@@ -1756,7 +1749,6 @@ int drm_mode_rmfb(struct drm_device *dev, ...@@ -1756,7 +1749,6 @@ int drm_mode_rmfb(struct drm_device *dev,
obj = drm_mode_object_find(dev, *id, DRM_MODE_OBJECT_FB); obj = drm_mode_object_find(dev, *id, DRM_MODE_OBJECT_FB);
/* TODO check that we really get a framebuffer back. */ /* TODO check that we really get a framebuffer back. */
if (!obj) { if (!obj) {
DRM_ERROR("mode invalid framebuffer id\n");
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
} }
...@@ -1767,7 +1759,6 @@ int drm_mode_rmfb(struct drm_device *dev, ...@@ -1767,7 +1759,6 @@ int drm_mode_rmfb(struct drm_device *dev,
found = 1; found = 1;
if (!found) { if (!found) {
DRM_ERROR("tried to remove a fb that we didn't own\n");
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
} }
...@@ -1814,7 +1805,6 @@ int drm_mode_getfb(struct drm_device *dev, ...@@ -1814,7 +1805,6 @@ int drm_mode_getfb(struct drm_device *dev,
mutex_lock(&dev->mode_config.mutex); mutex_lock(&dev->mode_config.mutex);
obj = drm_mode_object_find(dev, r->fb_id, DRM_MODE_OBJECT_FB); obj = drm_mode_object_find(dev, r->fb_id, DRM_MODE_OBJECT_FB);
if (!obj) { if (!obj) {
DRM_ERROR("invalid framebuffer id\n");
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
} }
...@@ -1850,7 +1840,6 @@ int drm_mode_dirtyfb_ioctl(struct drm_device *dev, ...@@ -1850,7 +1840,6 @@ int drm_mode_dirtyfb_ioctl(struct drm_device *dev,
mutex_lock(&dev->mode_config.mutex); mutex_lock(&dev->mode_config.mutex);
obj = drm_mode_object_find(dev, r->fb_id, DRM_MODE_OBJECT_FB); obj = drm_mode_object_find(dev, r->fb_id, DRM_MODE_OBJECT_FB);
if (!obj) { if (!obj) {
DRM_ERROR("invalid framebuffer id\n");
ret = -EINVAL; ret = -EINVAL;
goto out_err1; goto out_err1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment