diff --git a/lib/iscsi/conn.c b/lib/iscsi/conn.c index 3acc9b14d..77f25a2a2 100644 --- a/lib/iscsi/conn.c +++ b/lib/iscsi/conn.c @@ -112,7 +112,7 @@ free_conn(struct spdk_iscsi_conn *conn) static struct spdk_iscsi_conn * find_iscsi_connection_by_id(int cid) { - if (g_conns_array[cid].is_valid == 1) { + if (g_conns_array != MAP_FAILED && g_conns_array[cid].is_valid == 1) { return &g_conns_array[cid]; } else { return NULL; diff --git a/lib/iscsi/iscsi_subsystem.c b/lib/iscsi/iscsi_subsystem.c index 5c44cd568..9f8e070e3 100644 --- a/lib/iscsi/iscsi_subsystem.c +++ b/lib/iscsi/iscsi_subsystem.c @@ -257,7 +257,7 @@ iscsi_initialize_all_pools(void) static void iscsi_check_pool(struct spdk_mempool *pool, size_t count) { - if (spdk_mempool_count(pool) != count) { + if (pool && spdk_mempool_count(pool) != count) { SPDK_ERRLOG("spdk_mempool_count(%s) == %zu, should be %zu\n", spdk_mempool_get_name(pool), spdk_mempool_count(pool), count); }