malloc: fix potential null pointer dereference
authorTiwei Bie <tiwei.bie@intel.com>
Wed, 15 Aug 2018 07:20:15 +0000 (15:20 +0800)
committerThomas Monjalon <thomas@monjalon.net>
Sun, 16 Sep 2018 09:23:12 +0000 (11:23 +0200)
commitdde37a8fb86dd66b81378255f2c9dfe0c9b2cec9
treebaa13cc1509140f34af66e6d850087c472a05125
parent68acaa86ae639e3cdd94e419f546045a1b0ce6ca
malloc: fix potential null pointer dereference

We need to do the NULL pointer check first after malloc().

Fixes: 07dcbfe0101f ("malloc: support multiprocess memory hotplug")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
lib/librte_eal/common/malloc_heap.c
lib/librte_eal/common/malloc_mp.c