commit | 7982aa7da64b68f38c7ec685a428334e3af4e340 | [log] [tgz] |
---|---|---|
author | Jens Axboe <axboe@kernel.dk> | Fri Nov 02 16:35:18 2012 +0100 |
committer | Jens Axboe <axboe@kernel.dk> | Fri Nov 02 16:35:18 2012 +0100 |
tree | 6e11edfff85ab189ccf9107a45ba747fe02bd772 | |
parent | ea6209ad989dfb437aec487d26d4209bcf755d2c [diff] [blame] |
smalloc: fix int truncation issue Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/smalloc.c b/smalloc.c index d0b6f1e..9f40f65 100644 --- a/smalloc.c +++ b/smalloc.c
@@ -431,10 +431,13 @@ return ptr; } -void *smalloc(unsigned int size) +void *smalloc(size_t size) { unsigned int i; + if (size != (unsigned int) size) + return NULL; + global_write_lock(); i = last_pool;