diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2008-05-27 14:44:23 +0200 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2008-05-27 14:44:23 +0200 |
commit | 1601cc905c8b42d8b1735e0767ac753df8805ad9 (patch) | |
tree | 9c00d8f664a8bca17896632101f5124f6c3b6229 /smalloc.c | |
parent | 076b17cea9c9d6c86b926a166ef58f02334c9bdc (diff) | |
download | fio-1601cc905c8b42d8b1735e0767ac753df8805ad9.tar.gz |
smalloc: fix off-by-one in ptr_valid()
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'smalloc.c')
-rw-r--r-- | smalloc.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -90,7 +90,7 @@ static inline void global_write_unlock(void) static inline int ptr_valid(struct pool *pool, void *ptr) { - unsigned int pool_size = pool->nr_blocks * SMALLOC_BPL; + unsigned int pool_size = (pool->nr_blocks + 1) * SMALLOC_BPL; return (ptr >= pool->map) && (ptr < pool->map + pool_size); } |