eal/linux: fix device monitor stop return
authorWenxuan Wu <wenxuanx.wu@intel.com>
Fri, 11 Feb 2022 08:41:31 +0000 (08:41 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 7 Mar 2022 18:21:18 +0000 (19:21 +0100)
The ret value in rte_dev_event_monitor_stop stands for whether the
monitor has been successfully closed, and should not bind with
rte_intr_callback_unregister, so once it goes to the right exit point of
rte_dev_event_monitor, the ret value should be set to 0.

Also, the refmonitor count has been carefully evaluated, the value
change from 1 to 0, so there is no potential memory leak failure.

Fixes: 1fef6ced07f3 ("eal/linux: allow multiple starts of event monitor")
Cc: stable@dpdk.org
Signed-off-by: Wenxuan Wu <wenxuanx.wu@intel.com>
lib/eal/linux/eal_dev.c

index e6f509b..02ae1cd 100644 (file)
@@ -380,6 +380,7 @@ rte_dev_event_monitor_stop(void)
        close(rte_intr_fd_get(intr_handle));
        rte_intr_instance_free(intr_handle);
        intr_handle = NULL;
        close(rte_intr_fd_get(intr_handle));
        rte_intr_instance_free(intr_handle);
        intr_handle = NULL;
+       ret = 0;
 
        monitor_refcount--;
 
 
        monitor_refcount--;