aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_rect.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/drm_rect.c')
-rw-r--r--drivers/gpu/drm/drm_rect.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_rect.c b/drivers/gpu/drm/drm_rect.c
index 66c41b12719c..70f0dc83d1d7 100644
--- a/drivers/gpu/drm/drm_rect.c
+++ b/drivers/gpu/drm/drm_rect.c
@@ -52,7 +52,12 @@ EXPORT_SYMBOL(drm_rect_intersect);
static u32 clip_scaled(u32 src, u32 dst, u32 clip)
{
- u64 tmp = mul_u32_u32(src, dst - clip);
+ u64 tmp;
+
+ if (dst == 0)
+ return 0;
+
+ tmp = mul_u32_u32(src, dst - clip);
/*
* Round toward 1.0 when clipping so that we don't accidentally