test/nvme_impl.h: restore posix_memalign() check

If posix_memalign() fails, it may not have updated buf, so set it to
NULL explicitly.

Change-Id: I756bdc59ec1e31987ad3e6754eec4e2194b95074
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Daniel Verkamp 2016-09-27 15:34:34 -07:00
parent 372942e569
commit bb817900c9

View File

@ -151,7 +151,9 @@ nvme_mempool_create(const char *name, unsigned n, unsigned elt_size,
static inline void
nvme_mempool_get(nvme_mempool_t *mp, void **buf)
{
posix_memalign(buf, 64, 0x1000);
if (posix_memalign(buf, 64, 0x1000)) {
*buf = NULL;
}
}
static inline void