event: Handle invalid lcore passed to spdk_event_allocate
Change-Id: Ib438db398f899946ef7d2f1be3d4c7424ed2fbcf Signed-off-by: Ben Walker <benjamin.walker@intel.com> Reviewed-on: https://review.gerrithub.io/408252 Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
parent
4149205c46
commit
6518338fa0
@ -141,6 +141,11 @@ spdk_event_allocate(uint32_t lcore, spdk_event_fn fn, void *arg1, void *arg2)
|
|||||||
struct spdk_event *event = NULL;
|
struct spdk_event *event = NULL;
|
||||||
struct spdk_reactor *reactor = spdk_reactor_get(lcore);
|
struct spdk_reactor *reactor = spdk_reactor_get(lcore);
|
||||||
|
|
||||||
|
if (!reactor) {
|
||||||
|
assert(false);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
event = spdk_mempool_get(reactor->event_mempool);
|
event = spdk_mempool_get(reactor->event_mempool);
|
||||||
if (event == NULL) {
|
if (event == NULL) {
|
||||||
assert(false);
|
assert(false);
|
||||||
|
Loading…
Reference in New Issue
Block a user