If the timer subsystem is not initialized before rte_timer_manage (for
example) is invoked, a pointer to a shared hugepage memory region will
still be null and dereferenced when it is checked for validity; handle
this case.
Fixes:
c0749f7096c7 ("timer: allow management in shared memory")
Cc: stable@dpdk.org
Signed-off-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
static inline int
timer_data_valid(uint32_t id)
{
- return !!(rte_timer_data_arr[id].internal_flags & FL_ALLOCATED);
+ return rte_timer_data_arr &&
+ (rte_timer_data_arr[id].internal_flags & FL_ALLOCATED);
}
/* validate ID and retrieve timer data pointer, or return error value */