]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/msm/submit: fix overflow check on 64-bit architectures
authorArnd Bergmann <arnd@arndb.de>
Mon, 27 Sep 2021 11:36:23 +0000 (13:36 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Oct 2021 09:57:57 +0000 (11:57 +0200)
commit00ba7a3951f4ea7c91b29e2bfbb3a4ecf72bf542
tree8674463562196faa33f46e51b937aa05a9974bab
parent2d28dafbc88e26250b1332c8acf650ff280eccbd
drm/msm/submit: fix overflow check on 64-bit architectures

commit 95c58291ee709424557996891926a05a32c5b13a upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/msm/msm_gem_submit.c