Home Home > GIT Browse > SLE15-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-02-15 09:21:34 +0100
committerTakashi Iwai <tiwai@suse.de>2019-02-15 09:21:34 +0100
commitdf7a74ab3ac4a6b326c2d1cb43b4e28f04d9b4ca (patch)
treefac5ce9d449d7ced5ea6fc4d9585ea41af5f24b4
parent885b807a6c73faab7e6e6acf04b89f15e75baa47 (diff)
drm/modes: Prevent division by zero htotal (bsc#1051510).
-rw-r--r--drivers/gpu/drm/drm_modes.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index 49e724936ed3..767cbe5ca813 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -751,7 +751,7 @@ int drm_mode_hsync(const struct drm_display_mode *mode)
if (mode->hsync)
return mode->hsync;
- if (mode->htotal < 0)
+ if (mode->htotal <= 0)
return 0;
calc_val = (mode->clock * 1000) / mode->htotal; /* hsync in Hz */