Messages in this thread | | | From | David Howells <> | Subject | Re: [PATCH 32/38] fs/cachefiles: remove invalid checks | Date | Mon, 21 Sep 2015 14:48:46 +0100 |
| |
Andrzej Hajda <a.hajda@samsung.com> wrote:
> The problem has been detected using proposed semantic patch > scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1].
This is a problem in your test. There's no actual problem with the code.
> - ASSERT(cache->fstop_percent >= 0 &&
This is fine. The compiler should just ignore it.
> - cache->fstop_percent < cache->fcull_percent && > - cache->fcull_percent < cache->frun_percent && > - cache->frun_percent < 100); > + ASSERT(cache->fstop_percent < cache->fcull_percent && > + cache->fcull_percent < cache->frun_percent);
You've lost the upper bound check.
> - if (datalen < 0 || datalen > PAGE_SIZE - 1) > - if (fstop < 0 || fstop >= cache->fcull_percent) > - if (bstop < 0 || bstop >= cache->bcull_percent)
These are all fine. The compiler should just ignore them.
David
| |