From ec013016ed643e19a4fd509b01973c2b6b8ca0ea Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Wed, 18 Apr 2018 13:14:17 -0700 Subject: [PATCH] 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: Daniel Verkamp Reviewed-on: https://review.gerrithub.io/408234 Tested-by: SPDK Automated Test System Reviewed-by: Ben Walker Reviewed-by: Jim Harris --- lib/iscsi/iscsi_subsystem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/iscsi/iscsi_subsystem.c b/lib/iscsi/iscsi_subsystem.c index 0ec191c228..8b8e70231d 100644 --- a/lib/iscsi/iscsi_subsystem.c +++ b/lib/iscsi/iscsi_subsystem.c @@ -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);