Commit 3a70fc0d authored by wuzhouhui's avatar wuzhouhui Committed by Changpeng Liu
Browse files

rte_vhost:rte_vhost_driver_register(): check if strdup succeeds



Change-Id: I95e10ca3f7a8e212b46a9c5a62d18cbf2b1fff45
Signed-off-by: default avatarwuzhouhui <wuzhouhui@kingsoft.com>
Reviewed-on: https://review.gerrithub.io/423046


Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
parent 0309efde
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -635,6 +635,10 @@ rte_vhost_driver_register(const char *path, uint64_t flags)
		goto out;
	memset(vsocket, 0, sizeof(struct vhost_user_socket));
	vsocket->path = strdup(path);
	if (!vsocket->path) {
		free(vsocket);
		goto out;
	}
	TAILQ_INIT(&vsocket->conn_list);
	pthread_mutex_init(&vsocket->conn_mutex, NULL);
	vsocket->dequeue_zero_copy = flags & RTE_VHOST_USER_DEQUEUE_ZERO_COPY;