vfio: fix leak with multiprocess
authorJim Harris <james.r.harris@intel.com>
Fri, 16 Aug 2019 12:13:42 +0000 (05:13 -0700)
committerDavid Marchand <david.marchand@redhat.com>
Tue, 15 Oct 2019 18:36:58 +0000 (20:36 +0200)
commit773a860aef951727ea0c5af0f83e15fb0e24e03d
tree44dec33895951eb2218e8ba9ef110170ab6b919d
parent31b798a6f08e9b333b94b8bb26910209aa810b73
vfio: fix leak with multiprocess

The code checks both rte_mp_request_sync() return code and that the number
of messages in the reply equals 1.  If rte_mp_request_sync() succeeds but
there was more than one message, those messages would get leaked.

Found via code review by Anatoly Burakov of patches that used the vhost
code as a template for using rte_mp_request_sync().

Fixes: 83a73c5fef66 ("vfio: use generic multi-process channel")
Cc: stable@dpdk.org
Reported-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
lib/librte_eal/linux/eal/eal_vfio.c