From: Thomas Hellstrom Date: Thu, 19 Jan 2017 19:01:04 +0000 (-0800) Subject: drm/vmwgfx: Fix a potential integer overflow X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0f580386b6ad295c04c1b32120826494f8a29c1c;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git drm/vmwgfx: Fix a potential integer overflow Found by coverity. Signed-off-by: Thomas Hellstrom Reviewed-by: Sinclair Yeh Reviewed-by: Charmaine Lee --- diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c index 7d3cb7824fa1..d492d57d5309 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c @@ -1671,7 +1671,7 @@ int vmw_kms_update_layout_ioctl(struct drm_device *dev, void *data, * 1. Bounding box (assuming 32bpp) must be < prim_bb_mem * 2. Total pixels (assuming 32bpp) must be < prim_bb_mem */ - u64 bb_mem = bounding_box.w * bounding_box.h * 4; + u64 bb_mem = (u64) bounding_box.w * bounding_box.h * 4; u64 pixel_mem = total_pixels * 4; if (bb_mem > dev_priv->prim_bb_mem) {