Re: [patch 2/2] misc: mic/scif: fix wrap around tests

2015-10-14 Thread Dan Carpenter
On Tue, Oct 13, 2015 at 08:21:24PM -0700, Sudeep Dutt wrote: > > @@ -1613,7 +1613,7 @@ off_t scif_register(scif_epd_t epd, void *addr, > > size_t len, off_t offset, > > if ((map_flags & SCIF_MAP_FIXED) && > > ((ALIGN(offset, PAGE_SIZE) != offset) || > > (offset < 0) || > > -

Re: [patch 2/2] misc: mic/scif: fix wrap around tests

2015-10-13 Thread Sudeep Dutt
On Fri, 2015-10-09 at 09:40 +0300, Dan Carpenter wrote: > Signed integer overflow is undefined. Also I added a check for > "(offset < 0)" in scif_unregister() because that makes it match the > other conditions and because I didn't want to subtract a negative. > > Fixes: ba612aa8b487 ('misc: mic:

Re: [patch 2/2] misc: mic/scif: fix wrap around tests

2015-10-13 Thread Dan Carpenter
On Sun, Oct 11, 2015 at 02:14:44AM -0700, Sudeep Dutt wrote: > On Fri, 2015-10-09 at 09:40 +0300, Dan Carpenter wrote: > > Signed integer overflow is undefined. Also I added a check for > > "(offset < 0)" in scif_unregister() because that makes it match the > > other conditions and because I didn'

Re: [patch 2/2] misc: mic/scif: fix wrap around tests

2015-10-11 Thread Sudeep Dutt
On Fri, 2015-10-09 at 09:40 +0300, Dan Carpenter wrote: > Signed integer overflow is undefined. Also I added a check for > "(offset < 0)" in scif_unregister() because that makes it match the > other conditions and because I didn't want to subtract a negative. > > Fixes: ba612aa8b487 ('misc: mic: