bus/vdev: fix multi-process IPC buffer leak on scan
authorPaul Luse <paul.e.luse@intel.com>
Fri, 21 Sep 2018 16:25:57 +0000 (12:25 -0400)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 25 Oct 2018 08:28:13 +0000 (10:28 +0200)
This patch fixes an issue caught with ASAN where a vdev_scan()
to a secondary bus was failing to free some memory.

The doxygen comment in EAL is fixed at the same time.

Fixes: cdb068f031c6 ("bus/vdev: scan by multi-process channel")
Fixes: 783b6e54971d ("eal: add synchronous multi-process communication")
Cc: stable@dpdk.org
Signed-off-by: Paul Luse <paul.e.luse@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
drivers/bus/vdev/vdev.c
lib/librte_eal/common/include/rte_eal.h

index 688e31c..685cc4e 100644 (file)
@@ -425,6 +425,7 @@ vdev_scan(void)
                        mp_rep = &mp_reply.msgs[0];
                        resp = (struct vdev_param *)mp_rep->param;
                        VDEV_LOG(INFO, "Received %d vdevs", resp->num);
+                       free(mp_reply.msgs);
                } else
                        VDEV_LOG(ERR, "Failed to request vdev from primary");
 
index 3ee897c..6514a9f 100644 (file)
@@ -316,7 +316,7 @@ rte_mp_sendmsg(struct rte_mp_msg *msg);
  *
  * @param reply
  *   The reply argument will be for storing all the replied messages;
- *   the caller is responsible for free reply->replies.
+ *   the caller is responsible for free reply->msgs.
  *
  * @param ts
  *   The ts argument specifies how long we can wait for the peer(s) to reply.