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:
parent
992b168ee5
commit
5a499ac098
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user