blob: check memory allocation in check_readahead

Change-Id: I80a1b19570aab8145e8d8d2c544ed46576a89e60
Signed-off-by: GangCao <gang.cao@intel.com>
This commit is contained in:
GangCao 2017-03-26 19:30:27 -04:00 committed by Daniel Verkamp
parent 55d8cca428
commit 57986fb884

View File

@ -1916,8 +1916,13 @@ check_readahead(struct spdk_file *file, uint64_t offset)
return;
}
BLOBFS_TRACE(file, "offset=%jx\n", offset);
args = calloc(1, sizeof(*args));
if (args == NULL) {
return;
}
BLOBFS_TRACE(file, "offset=%jx\n", offset);
args->file = file;
args->op.readahead.offset = offset;
args->op.readahead.cache_buffer = cache_insert_buffer(file, offset);