drm: cast calculation to __u64 in qxl_mode_dumb_create()
Subsystems (4)
PATCH 1/1 drm: cast calculation to __u64 in qxl_mode_dumb_create()
From: Zichen Xie <[email protected]>
Like commit b0b0d811eac6 ("drm/mediatek: Fix coverity issue with unintentional integer overflow"), directly multiply pitch and args->height may lead to integer overflow. Add a cast to avoid it.
Signed-off-by Zichen Xie <[email protected]>
--- drivers/gpu/drm/qxl/qxl_dumb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/qxl/qxl_dumb.c +1 -1
@@ -41,7 +41,7 @@ int qxl_mode_dumb_create(struct drm_file *file_priv,uint32_t pitch, format; pitch = args->width * ((args->bpp +1 ) /8 ); - args->size = pitch * args->height; + args->size = (__u64 )pitch * args->height; args->size =ALIGN (args->size,PAGE_SIZE );switch (args->bpp) {
Signature · 1 line
2.34.1