mem: add logic check for static analyzer
authorAnatoly Burakov <anatoly.burakov@intel.com>
Tue, 17 Jul 2018 15:41:45 +0000 (16:41 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 20 Jul 2018 09:32:03 +0000 (11:32 +0200)
commitdd536a8bc5bb1f2b7e530272c9a2d2c15c7fdb32
tree5d01242706173958107daab394b4614c074bf6a3
parent9554dbb50a8a22942128a0e5bcb52243a4f723ab
mem: add logic check for static analyzer

Technically, single file segments codepath will never get
triggered when using in-memory mode, because EAL prohibits
mixing these two options at initialization time. However,
code analyzers do not know that, and some will complain
about either using uninitialized variables, or trying to
do operations on an already closed descriptor.

Fix this by assuring the compiler or code analyzer that
in-memory mode code never gets triggered when using
single-file segments mode.

Coverity issue: 302847
Fixes: 72b49ff623c4 ("mem: support --in-memory mode")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
lib/librte_eal/linuxapp/eal/eal_memalloc.c