On Thu, Jan 08, 2026 at 10:57:22PM +0300, Dan Carpenter wrote:
> This is supposed to test for integer overflow but it is wrong and
> unnecessary.  The size_add()/mul() macros return SIZE_MAX when there is
> an integer overflow.  This code saves the SIZE_MAX to a u64 and then
> tests if the result is greater than SIZE_MAX which it never will be.
> Fortunately, when we try to allocate SIZE_MAX bytes the allocation
> will fail.  We even pass __GFP_NOWARN so the allocation fails
> harmlessly and quietly.
> 
> Signed-off-by: Dan Carpenter <[email protected]>
> ---
>  drivers/gpu/drm/msm/msm_gem_vma.c | 8 +-------
>  1 file changed, 1 insertions(+), 7 deletions(-)

Fixes: 2e6a8a1fe2b2 ("drm/msm: Add VM_BIND ioctl")

Reviewed-by: Dmitry Baryshkov <[email protected]>


-- 
With best wishes
Dmitry

Reply via email to