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 <daniel.verkamp@intel.com> Reviewed-on: https://review.gerrithub.io/408234 Tested-by: SPDK Automated Test System <sys_sgsw@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
b67f1afe8e
commit
ec013016ed
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user