Skip to content

Commit 95c5829

Browse files
arndbrobclark
authored andcommitted
drm/msm/submit: fix overflow check on 64-bit architectures
The overflow check does causes a warning from clang-14 when 'sz' is a type that is smaller than size_t: drivers/gpu/drm/msm/msm_gem_submit.c:217:10: error: result of comparison of constant 18446744073709551615 with expression of type 'unsigned int' is always false [-Werror,-Wtautological-constant-out-of-range-compare] if (sz == SIZE_MAX) { Change the type accordingly. Fixes: 20224d7 ("drm/msm/submit: Move copy_from_user ahead of locking bos") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Stephen Boyd <swboyd@chromium.org> Link: https://lore.kernel.org/r/20210927113632.3849987-1-arnd@kernel.org Signed-off-by: Rob Clark <robdclark@chromium.org>
1 parent 6800246 commit 95c5829

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/gpu/drm/msm/msm_gem_submit.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ static int submit_lookup_objects(struct msm_gem_submit *submit,
171171
static int submit_lookup_cmds(struct msm_gem_submit *submit,
172172
struct drm_msm_gem_submit *args, struct drm_file *file)
173173
{
174-
unsigned i, sz;
174+
unsigned i;
175+
size_t sz;
175176
int ret = 0;
176177

177178
for (i = 0; i < args->nr_cmds; i++) {

0 commit comments

Comments
 (0)