hash: fix out-of-memory handling in hash creation
authorYunjian Wang <wangyunjian@huawei.com>
Wed, 22 Jul 2020 03:58:58 +0000 (11:58 +0800)
committerDavid Marchand <david.marchand@redhat.com>
Mon, 27 Jul 2020 10:53:40 +0000 (12:53 +0200)
commita5f803c804c4f75ce7c736a143170c49bb7e72c9
tree9c87f9d68805b67b5c0f5f79b9fd1ad05aae05f8
parent3126c6e04118e92364571b7020f7bb1567bac694
hash: fix out-of-memory handling in hash creation

The function rte_zmalloc_socket() could return NULL, the return
value need to be checked.

Fixes: 5915699153d7 ("hash: fix scaling by reducing contention")
Cc: stable@dpdk.org
Reported-by: Bin Huang <brian.huangbin@huawei.com>
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
lib/librte_hash/rte_cuckoo_hash.c