timer: fix null access if not initialized
authorErik Gabriel Carrillo <erik.g.carrillo@intel.com>
Mon, 15 Jul 2019 15:39:31 +0000 (10:39 -0500)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 18 Jul 2019 21:14:53 +0000 (23:14 +0200)
commitc485a5e65a641b64e2bcd2959aa151e6278be0c4
treee60255902459686df21504b535a9f780b8410fce
parentfaa4ee75364dcb5343790d5fcf850cebdf7353f6
timer: fix null access if not initialized

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>
lib/librte_timer/rte_timer.c