From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5A116A00BE; Fri, 11 Feb 2022 10:01:34 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F2680410E5; Fri, 11 Feb 2022 10:01:33 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id DCB5140042 for ; Fri, 11 Feb 2022 10:01:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644570092; x=1676106092; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=ScXhd/21RsAhyhHRbRhhtwDqzybShVcIAL4YUqAr52M=; b=ItKLHB2hWvwd6I1HgjXQDMcqbeAw5kefaOA+PK87ZPHl29QK0tvz+/vX pSbPuuYhx2bnUCzHWA4UXWF9iLKl6DTAsLGDyvYKtoFxwL8wZ19j63O5P YNHvKKae5wyfdx7pBaR73kzg2enYf6CZ3IuZMKcybWybbZn8BV/oFj/uL dtAjmoi7g2qCxwNsJzzP1y3Uz5aCGuZbmg7pnsqw0zDXFJ0dFbqAP69kU IgIxk1RnGHzjFM6hbj1qVqyPLBwP4YwKVldc7t9XrhgYaj6du403HLnrF 2ah4D9715ZkLgNHwKD08ZXt/ZcKgWhZTAtIPbUOPwF8VblVl9yNz8W1fZ g==; X-IronPort-AV: E=McAfee;i="6200,9189,10254"; a="336115415" X-IronPort-AV: E=Sophos;i="5.88,360,1635231600"; d="scan'208";a="336115415" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Feb 2022 01:01:30 -0800 X-IronPort-AV: E=Sophos;i="5.88,360,1635231600"; d="scan'208";a="623159304" Received: from unknown (HELO localhost.localdomain) ([10.239.251.3]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Feb 2022 01:01:29 -0800 From: wenxuanx.wu@intel.com To: qiming.yang@intel.com, qi.z.zhang@intel.com Cc: dev@dpdk.org, nhorman@tuxdriver.com Subject: [DPDK] /lib/eal: fix failed to stop device monitor error Date: Fri, 11 Feb 2022 08:41:31 +0000 Message-Id: <20220211084131.72606-1-wenxuanx.wu@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Wenxuan Wu 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@intel.com Signed-off-by: Wenxuan Wu --- lib/eal/linux/eal_dev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/eal/linux/eal_dev.c b/lib/eal/linux/eal_dev.c index bde55a3d92..4646e8a550 100644 --- a/lib/eal/linux/eal_dev.c +++ b/lib/eal/linux/eal_dev.c @@ -384,6 +384,7 @@ rte_dev_event_monitor_stop(void) close(rte_intr_fd_get(intr_handle)); rte_intr_instance_free(intr_handle); intr_handle = NULL; + ret = 0; monitor_refcount--; -- 2.25.1