fbarray: fix potential null-dereference
authorAnatoly Burakov <anatoly.burakov@intel.com>
Tue, 17 Apr 2018 15:44:07 +0000 (16:44 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 23 Apr 2018 20:44:21 +0000 (22:44 +0200)
commitf9a4f1b4623a8f6673a15670c314be18c0efe623
treef3f2bc7335ecc6eaf3950f0289fda160b1b384fe
parent2bcbc4d12c9c1be7e6bf59b1acc3c3f5edd7900c
fbarray: fix potential null-dereference

We get pointer to mask before we check if fbarray is NULL. Fix
by moving getting mask pointer to until after NULL check.

Coverity issue: 272579
Fixes: c44d09811b40 ("eal: add shared indexed file-backed array")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
lib/librte_eal/common/eal_common_fbarray.c