nvmf: remove pointless strdup() in discovery setup

nvmf_create_subsystem() already copies the name, so the strdup() in the
caller is unnecessary.

Change-Id: I225f0f077fee30051b197a4b1d7276b113ec6b01
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Daniel Verkamp 2016-07-22 12:52:24 -07:00
parent 9b9e3253e6
commit d8efd71455

View File

@ -72,23 +72,14 @@ static int
spdk_add_nvmf_discovery_subsystem(void)
{
struct spdk_nvmf_subsystem *subsystem;
char *name;
name = strdup(SPDK_NVMF_DISCOVERY_NQN);
if (name == NULL) {
SPDK_ERRLOG("strdup ss_group->name error\n");
return -1;
}
subsystem = nvmf_create_subsystem(0, name, SPDK_NVMF_SUBTYPE_DISCOVERY, rte_get_master_lcore());
subsystem = nvmf_create_subsystem(0, SPDK_NVMF_DISCOVERY_NQN, SPDK_NVMF_SUBTYPE_DISCOVERY,
rte_get_master_lcore());
if (subsystem == NULL) {
SPDK_ERRLOG("Failed creating discovery nvmf library subsystem\n");
free(name);
return -1;
}
free(name);
return 0;
}