mem: avoid crash on memseg query with invalid address
authorDariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Mon, 4 Jun 2018 05:33:41 +0000 (07:33 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 12 Jul 2018 22:25:08 +0000 (00:25 +0200)
commit09037cf36c0888b6310d0e56739954e7bf691f97
tree73a8888121cd7e3fff80692506c235d72459442c
parent0762c438b8da8486b283f4da0c01a85f684b8896
mem: avoid crash on memseg query with invalid address

When trying to use it with an address that's not
managed by DPDK it would segfault due to a missing
check. The doc says this function returns either
a pointer or NULL, so let it do so.

Fixes: 66cc45e293ed ("mem: replace memseg with memseg lists")
Cc: stable@dpdk.org
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
lib/librte_eal/common/eal_common_memory.c