Re: [PATCH v2] drm/i915: Fix integer overflow tests

2017-08-18 Thread Dan Carpenter
On Fri, Aug 18, 2017 at 08:46:25AM +0100, Chris Wilson wrote: > Quoting Dan Carpenter (2017-08-18 08:07:00) > > There are some potential integer overflows here on 64 bit systems. > > > > The condition "if (nfences > SIZE_MAX / sizeof(*fences))" can only be > > true on 32 bit systems, it's a no-op

Re: [PATCH v2] drm/i915: Fix integer overflow tests

2017-08-18 Thread Chris Wilson
Quoting Dan Carpenter (2017-08-18 08:07:00) > There are some potential integer overflows here on 64 bit systems. > > The condition "if (nfences > SIZE_MAX / sizeof(*fences))" can only be > true on 32 bit systems, it's a no-op on 64 bit, so let's ignore the > check for now and look a couple lines a

[PATCH v2] drm/i915: Fix integer overflow tests

2017-08-18 Thread Dan Carpenter
There are some potential integer overflows here on 64 bit systems. The condition "if (nfences > SIZE_MAX / sizeof(*fences))" can only be true on 32 bit systems, it's a no-op on 64 bit, so let's ignore the check for now and look a couple lines after: if (!access_ok(VERIFY_READ, user, nfenc