ipc: fix undefined behavior in no-shconf mode
authorDariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Wed, 24 Oct 2018 10:05:17 +0000 (12:05 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 24 Oct 2018 19:49:57 +0000 (21:49 +0200)
commitb4f62e586279bd5c49933f0e873adf047847e556
treec2ea597c07b053082c9a3a0a874bb11f733e10b5
parent25495407cbda028f7f6d5cce38f78e609cf970e1
ipc: fix undefined behavior in no-shconf mode

In no-shconf mode the rte_mp_request_sync() wasn't initializing
the `reply` parameter, which contained e.g. a number of sent
requests. Callers of rte_mp_request_sync() might check that
param afterwards and might read potentially unitialized memory.

The no-shconf check that makes us return early (with rc = 0) was
placed before the `reply` initialization. Fix this by making the
`reply` initialization occur first.

Fixes: 5848e3d2813c ("ipc: support --no-shconf mode")
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_proc.c