spdk: Add callback NULL check for readv and writev command

Change-Id: I04286c97ff0536127dbbc4bd1d65ee44a128ecf5
Signed-off-by: Liang Yan <liangx.yan@intel.com>
This commit is contained in:
Liang Yan 2016-02-04 14:06:46 +08:00 committed by Daniel Verkamp
parent 7a9b004c65
commit ee292e4b55

View File

@ -203,6 +203,9 @@ nvme_ns_cmd_readv(struct nvme_namespace *ns, uint64_t lba, uint32_t lba_count,
struct nvme_request *req;
struct nvme_payload payload;
if (reset_sgl_fn == NULL || next_sge_fn == NULL)
return EINVAL;
payload.type = NVME_PAYLOAD_TYPE_SGL;
payload.u.sgl.reset_sgl_fn = reset_sgl_fn;
payload.u.sgl.next_sge_fn = next_sge_fn;
@ -245,6 +248,9 @@ nvme_ns_cmd_writev(struct nvme_namespace *ns, uint64_t lba, uint32_t lba_count,
struct nvme_request *req;
struct nvme_payload payload;
if (reset_sgl_fn == NULL || next_sge_fn == NULL)
return EINVAL;
payload.type = NVME_PAYLOAD_TYPE_SGL;
payload.u.sgl.reset_sgl_fn = reset_sgl_fn;
payload.u.sgl.next_sge_fn = next_sge_fn;