summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/drm_rect.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2016-07-26 19:06:56 +0300
committerSean Paul <seanpaul@chromium.org>2016-08-08 14:17:56 -0400
commit1e1a5f8f8c3a4b24b3fc0340880cf1e3949f4997 (patch)
tree70cee84ece12318cb3d50c69a490925c7da115c8 /drivers/gpu/drm/drm_rect.c
parent31ad61e4afa53a7b2e364f7c021546fbc6ce0d85 (diff)
drm: Warn about negative sizes when calculating scale factor
Passing negative width/hight to scale factor calculations is not legal. Let's WARN if that happens. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: http://patchwork.freedesktop.org/patch/msgid/1469549224-1860-2-git-send-email-ville.syrjala@linux.intel.com
Diffstat (limited to 'drivers/gpu/drm/drm_rect.c')
-rw-r--r--drivers/gpu/drm/drm_rect.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_rect.c b/drivers/gpu/drm/drm_rect.c
index 4063f6e4ea9f..73e53a8d1b37 100644
--- a/drivers/gpu/drm/drm_rect.c
+++ b/drivers/gpu/drm/drm_rect.c
@@ -100,7 +100,7 @@ static int drm_calc_scale(int src, int dst)
{
int scale = 0;
- if (src < 0 || dst < 0)
+ if (WARN_ON(src < 0 || dst < 0))
return -EINVAL;
if (dst == 0)