diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2017-01-19 20:01:04 +0100 |
---|---|---|
committer | Sinclair Yeh <syeh@vmware.com> | 2017-01-27 05:52:51 +0100 |
commit | 0f580386b6ad295c04c1b32120826494f8a29c1c (patch) | |
tree | 32e040c9ee945d4a52c9bad76ee031d89e538a8c /drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | |
parent | drm/vmwgfx: Clear an uninitialized struct member (diff) | |
download | linux-0f580386b6ad295c04c1b32120826494f8a29c1c.tar.xz linux-0f580386b6ad295c04c1b32120826494f8a29c1c.zip |
drm/vmwgfx: Fix a potential integer overflow
Found by coverity.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_kms.c')
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) { |