bdev_nvme_rpc: NULL check for multipath
Pointer 'ctx->req.multipath' returned from call to function 'strdup' may be NULL. Reported by Klocwork. Change-Id: Id4a188ec5340f02c9bd0643db0acb03409dd5829 Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9843 Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: GangCao <gang.cao@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
parent
0403d3736a
commit
a3d93c468c
@ -398,6 +398,10 @@ rpc_bdev_nvme_attach_controller(struct spdk_jsonrpc_request *request,
|
||||
"it was used to add a failover path. This behavior will default to rejecting "
|
||||
"the request in the future. Specify the 'multipath' parameter to control the behavior");
|
||||
ctx->req.multipath = strdup("failover");
|
||||
if (ctx->req.multipath == NULL) {
|
||||
SPDK_ERRLOG("cannot allocate multipath failover string\n");
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
opts = spdk_nvme_ctrlr_get_opts(ctrlr->ctrlr);
|
||||
|
Loading…
Reference in New Issue
Block a user