reactor: improve spdk_reactor_get

Size of g_reactors allocated is g_reactor_count, so
valid lcore should be less than g_reactor_count.

Change-Id: I9d5cde7856d6b400a7188631812b53a7e5701d0f
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5870
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Liu Xiaodong 2021-01-12 05:36:33 -05:00 committed by Tomasz Zawadzki
parent 992b168ee5
commit 5a499ac098

View File

@ -181,6 +181,10 @@ spdk_reactor_get(uint32_t lcore)
return NULL;
}
if (lcore >= g_reactor_count) {
return NULL;
}
reactor = &g_reactors[lcore];
if (reactor->flags.is_valid == false) {