Commit 95c58291 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Rob Clark

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: 20224d71 ("drm/msm/submit: Move copy_from_user ahead of locking bos")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Reviewed-by: default avatarStephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20210927113632.3849987-1-arnd@kernel.orgSigned-off-by: default avatarRob Clark <robdclark@chromium.org>
parent 68002469
...@@ -171,7 +171,8 @@ static int submit_lookup_objects(struct msm_gem_submit *submit, ...@@ -171,7 +171,8 @@ static int submit_lookup_objects(struct msm_gem_submit *submit,
static int submit_lookup_cmds(struct msm_gem_submit *submit, static int submit_lookup_cmds(struct msm_gem_submit *submit,
struct drm_msm_gem_submit *args, struct drm_file *file) struct drm_msm_gem_submit *args, struct drm_file *file)
{ {
unsigned i, sz; unsigned i;
size_t sz;
int ret = 0; int ret = 0;
for (i = 0; i < args->nr_cmds; i++) { for (i = 0; i < args->nr_cmds; i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment