diff options
author | Arnd Bergmann <arnd@arndb.de> | 2021-09-27 13:36:23 +0200 |
---|---|---|
committer | Rob Clark <robdclark@chromium.org> | 2021-10-01 23:47:23 +0200 |
commit | 95c58291ee709424557996891926a05a32c5b13a (patch) | |
tree | 240e9c8c3dd1b973d6677e77a50471c1ce143ea2 | |
parent | drm/msm: One sched entity per process per priority (diff) | |
download | linux-95c58291ee709424557996891926a05a32c5b13a.tar.xz linux-95c58291ee709424557996891926a05a32c5b13a.zip |
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: 20224d715a88 ("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>
-rw-r--r-- | drivers/gpu/drm/msm/msm_gem_submit.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c b/drivers/gpu/drm/msm/msm_gem_submit.c index 7e0f6571cbca..151d19e4453c 100644 --- a/drivers/gpu/drm/msm/msm_gem_submit.c +++ b/drivers/gpu/drm/msm/msm_gem_submit.c @@ -171,7 +171,8 @@ out: static int submit_lookup_cmds(struct msm_gem_submit *submit, struct drm_msm_gem_submit *args, struct drm_file *file) { - unsigned i, sz; + unsigned i; + size_t sz; int ret = 0; for (i = 0; i < args->nr_cmds; i++) { |