Commit 57986fb8 authored by GangCao's avatar GangCao Committed by Daniel Verkamp
Browse files

blob: check memory allocation in check_readahead



Change-Id: I80a1b19570aab8145e8d8d2c544ed46576a89e60
Signed-off-by: default avatarGangCao <gang.cao@intel.com>
parent 55d8cca4
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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);