Fix NULL-pointer crash in handoff_init(...)
Change-Id: If403f83b4e918e81e7b2e90dfca14960ad2c6aa6 Signed-off-by: Dave Barach <dave@barachs.net>
This commit is contained in:
@ -513,11 +513,14 @@ clib_error_t *handoff_init (vlib_main_t *vm)
|
|||||||
vlib_thread_registration_t * tr;
|
vlib_thread_registration_t * tr;
|
||||||
/* Only the standard vnet worker threads are supported */
|
/* Only the standard vnet worker threads are supported */
|
||||||
p = hash_get_mem (tm->thread_registrations_by_name, "workers");
|
p = hash_get_mem (tm->thread_registrations_by_name, "workers");
|
||||||
tr = (vlib_thread_registration_t *) p[0];
|
if (p)
|
||||||
if (tr)
|
|
||||||
{
|
{
|
||||||
hm->num_workers = tr->count;
|
tr = (vlib_thread_registration_t *) p[0];
|
||||||
hm->first_worker_index = tr->first_index;
|
if (tr)
|
||||||
|
{
|
||||||
|
hm->num_workers = tr->count;
|
||||||
|
hm->first_worker_index = tr->first_index;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
hm->vlib_main = vm;
|
hm->vlib_main = vm;
|
||||||
|
Reference in New Issue
Block a user