lib/notify: fix checks in spdk_notify_type_register
Adjusting error logs, by the way. Change-Id: I84ec84e550d9bc7249e0af423faa0ab81cf1c892 Signed-off-by: wuzhouhui <wuzhouhui@kingsoft.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453142 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
0560976d51
commit
8b3533f502
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user