posix: Fix the ASAN issue whiling using internal buffer.

Fixes #1314

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I096dcba3d5eea91e79680ce64e894e7f10028ad3
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1459
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Ziye Yang 2020-03-26 07:29:43 +08:00 committed by Tomasz Zawadzki
parent 38fb0e01f7
commit cbe6e0f7cd

View File

@ -209,7 +209,7 @@ spdk_posix_sock_alloc_pipe(struct spdk_posix_sock *sock, int sz)
}
/* Round up to next 64 byte multiple */
new_buf = calloc(((sz + 1) >> 6) << 6, sizeof(uint8_t));
new_buf = calloc(SPDK_ALIGN_CEIL(sz + 1, 64), sizeof(uint8_t));
if (!new_buf) {
SPDK_ERRLOG("socket recv buf allocation failed\n");
return -ENOMEM;