drm/vc4: cast calculation to __u64 in vc4_dumb_fixup_args()
Subsystems (4)
PATCH 1/1 drm/vc4: cast calculation to __u64 in vc4_dumb_fixup_args()
From: Zichen Xie <[email protected]>
Like commit b0b0d811eac6 ("drm/mediatek: Fix coverity issue with unintentional integer overflow"), directly multiply args->pitch and args->height may lead to integer overflow. Add a cast to avoid it.
Fixes 3d7637423be8 ("drm/vc4: bo: Split out Dumb buffers fixup")
Signed-off-by Zichen Xie <[email protected]>
--- drivers/gpu/drm/vc4/vc4_drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/vc4/vc4_drv.c +2 -2
@@ -69,8 +69,8 @@ int vc4_dumb_fixup_args(struct drm_mode_create_dumb *args)if (args->pitch < min_pitch) args->pitch = min_pitch; -if (args->size < args->pitch * args->height) - args->size = args->pitch * args->height; +if (args->size < (__u64 )args->pitch * args->height) + args->size = (__u64 )args->pitch * args->height;return 0 ; }
Signature · 1 line
2.25.1