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

iscsi: fix nonsensical poll_group asserts



It doesn't make sense to assert(pg != NULL) after already dereferencing
the pg pointer.

Additionally, pg is pointing into the g_spdk_iscsi.poll_group array, so
it makes more sense to check that the poll_group array is non-NULL.

Change-Id: I167fed2bd73dc6a1894ff5b13d5bf3e5aa835f47
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/408234


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent b67f1afe
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -891,9 +891,9 @@ iscsi_create_poll_group(void *ctx)
{
	struct spdk_iscsi_poll_group *pg;

	assert(g_spdk_iscsi.poll_group != NULL);
	pg = &g_spdk_iscsi.poll_group[spdk_env_get_current_core()];
	pg->core = spdk_env_get_current_core();
	assert(pg != NULL);

	STAILQ_INIT(&pg->connections);
	pg->sock_group = spdk_sock_group_create();
@@ -909,8 +909,8 @@ iscsi_unregister_poll_group(void *ctx)
{
	struct spdk_iscsi_poll_group *pg;

	assert(g_spdk_iscsi.poll_group != NULL);
	pg = &g_spdk_iscsi.poll_group[spdk_env_get_current_core()];
	assert(pg != NULL);
	assert(pg->poller != NULL);
	assert(pg->sock_group != NULL);