Commit 8b3533f5 authored by wuzhouhui's avatar wuzhouhui Committed by Jim Harris
Browse files

lib/notify: fix checks in spdk_notify_type_register



Adjusting error logs, by the way.

Change-Id: I84ec84e550d9bc7249e0af423faa0ab81cf1c892
Signed-off-by: default avatarwuzhouhui <wuzhouhui@kingsoft.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453142


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 0560976d
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -62,9 +62,8 @@ spdk_notify_type_register(const char *type)
	if (!type) {
		SPDK_ERRLOG("Invalid notification type %p\n", type);
		return NULL;
	} else if (!type || strlen(type) >= SPDK_NOTIFY_MAX_NAME_SIZE) {
		SPDK_ERRLOG("Invalid notification type (add: %p, name: %s)\n", type,
			    type ? type : "(null)");
	} else if (!type[0] || strlen(type) >= SPDK_NOTIFY_MAX_NAME_SIZE) {
		SPDK_ERRLOG("Notification type '%s' too short or too long\n", type);
		return NULL;
	}