projects
/
fio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ea6209a
)
smalloc: fix int truncation issue
author
Jens Axboe
<axboe@kernel.dk>
Fri, 2 Nov 2012 15:35:18 +0000
(16:35 +0100)
committer
Jens Axboe
<axboe@kernel.dk>
Fri, 2 Nov 2012 15:35:18 +0000
(16:35 +0100)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
smalloc.c
patch
|
blob
|
blame
|
history
smalloc.h
patch
|
blob
|
blame
|
history
diff --git
a/smalloc.c
b/smalloc.c
index d0b6f1e1f0059fb266aac3334d078f36715fbacd..9f40f65a620afaf6881d01013c34e025192ee773 100644
(file)
--- a/
smalloc.c
+++ b/
smalloc.c
@@
-431,10
+431,13
@@
static void *smalloc_pool(struct pool *pool, unsigned int size)
return ptr;
}
-void *smalloc(
unsigned in
t size)
+void *smalloc(
size_
t size)
{
unsigned int i;
+ if (size != (unsigned int) size)
+ return NULL;
+
global_write_lock();
i = last_pool;
diff --git
a/smalloc.h
b/smalloc.h
index 6905c6a8c3c806a7ce20616452bb4b82f1fbfe89..f9a5e410fae79b570973a708c95f713912d8e40c 100644
(file)
--- a/
smalloc.h
+++ b/
smalloc.h
@@
-1,7
+1,7
@@
#ifndef FIO_SMALLOC_H
#define FIO_SMALLOC_H
-extern void *smalloc(
unsigned in
t);
+extern void *smalloc(
size_
t);
extern void sfree(void *);
extern char *smalloc_strdup(const char *);
extern void sinit(void);