projects
/
fio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9edf7b3
)
Fix potential NULL dereference in alloc_mem_mmap()
author
Jens Axboe
<axboe@fb.com>
Mon, 14 Apr 2014 19:20:38 +0000
(13:20 -0600)
committer
Jens Axboe
<axboe@fb.com>
Mon, 14 Apr 2014 19:20:38 +0000
(13:20 -0600)
Signed-off-by: Jens Axboe <axboe@fb.com>
memory.c
patch
|
blob
|
blame
|
history
diff --git
a/memory.c
b/memory.c
index b208320c5d88cc619f7167626e3b7502ded07799..8c06d94d85e7a48ecfb5d8681a8780658f567f6c 100644
(file)
--- a/
memory.c
+++ b/
memory.c
@@
-158,9
+158,10
@@
static int alloc_mem_mmap(struct thread_data *td, size_t total_mem)
if (td->orig_buffer == MAP_FAILED) {
td_verror(td, errno, "mmap");
td->orig_buffer = NULL;
if (td->orig_buffer == MAP_FAILED) {
td_verror(td, errno, "mmap");
td->orig_buffer = NULL;
- if (td->mmapfd) {
+ if (td->mmapfd
!= 1
) {
close(td->mmapfd);
close(td->mmapfd);
- unlink(td->o.mmapfile);
+ if (td->o.mmapfile)
+ unlink(td->o.mmapfile);
}
return 1;
}
return 1;