mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-19 18:24:14 +08:00
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
This commit is contained in:
parent
31ad61e4af
commit
1e1a5f8f8c
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user