malloc: fix duplicate mem event notification
authorAnatoly Burakov <anatoly.burakov@intel.com>
Tue, 11 Dec 2018 16:48:28 +0000 (16:48 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 20 Dec 2018 14:28:55 +0000 (15:28 +0100)
We already trigger a mem event notification inside the walk function,
no need to do it twice.

Fixes: f32c7c9de961 ("malloc: enable event callbacks for external memory")
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
lib/librte_eal/common/rte_malloc.c

index 0da5ad5..5f07b98 100644 (file)
@@ -517,13 +517,8 @@ sync_memory(const char *heap_name, void *va_addr, size_t len, bool attach)
        if (wa.result < 0) {
                rte_errno = -wa.result;
                ret = -1;
-       } else {
-               /* notify all subscribers that a new memory area was added */
-               if (attach)
-                       eal_memalloc_mem_event_notify(RTE_MEM_EVENT_ALLOC,
-                                       va_addr, len);
+       } else
                ret = 0;
-       }
 unlock:
        rte_rwlock_read_unlock(&mcfg->memory_hotplug_lock);
        return ret;