Commit d8efd714 authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

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: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent 9b9e3253
Loading
Loading
Loading
Loading
+2 −11
Original line number Diff line number Diff line
@@ -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;
}