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 3D8F2A0C51; Tue, 13 Jul 2021 15:17:35 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3595241285; Tue, 13 Jul 2021 15:17:30 +0200 (CEST) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by mails.dpdk.org (Postfix) with ESMTP id 7E7A54127F; Tue, 13 Jul 2021 15:17:29 +0200 (CEST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 2FC905C00E1; Tue, 13 Jul 2021 09:17:29 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 13 Jul 2021 09:17:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=fm1; bh=6D6RNjqDiKjnnN58kGF3iyiLeJ zCQVr0MS8RYKdlJWA=; b=3ef+n0Qn9pWK5C8z8cm2rzCWitVomG3+SWZzCdbgYB kkIxJLrI1qm4goY4ijJT+yFfHIrl3wz7WnNHpLnKcNxbO6s09ze/B3eaftM835vs 3d2KYZDBtk3ORZATiywrWGyCKYvNMOvhKC7MnilOBWEStAGqm/LAWvMLXCaAXofj jNR+LFIvRSlhmJLi0aXF7qyio7oZyGeKVSDDDuKa/tdA0Fw9hPD01k1mhrQmJtzZ hV4/9IXTDw9AK9BbsWlVVM7bIc6M3nWguzXDcaVVLrLwTYehR6KVN2MWv9C54ryQ QzmeaG5SbkXcpdZmnS8BiGzl5hyVkfnfk4D4yvG7BjIA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=6D6RNjqDiKjnnN58k GF3iyiLeJzCQVr0MS8RYKdlJWA=; b=Whm38gmMIXzyjnnvoZsCNj7pjC5txFeJJ eB39dWEBxDarfU0/J9tJrR6wYG93f/5E2OdOumG4hBJ/zwsG3KSOt2F56mg1b95F qMkc07Wn2IZZG9JiBejYqPwF01RA6gHY0P0ZU3gFYGYNPc+CSdQRlZBTuE7nODvY +RqRZPhoZuG0LwTnDDQ+3m6Q3IQZGaDminhDxYWAMUbQb35VRUrypdeAa8qN7k2H aROXJ/+4CVAFECu9Yarz8k74ranVW9oCgF4IVcuxK6Jr9MRFI9DNU7pGu+UaMMGi qOxEQGIx1iQFgLbsaqQTGUXGgnxwYecbZTLFlLJMEHDGPAVcM6gsQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudehgdehfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghsucfo ohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtffrrg htthgvrhhnpedvledvudehvdduudevuedvveehgeduleegiefgjeehudehtddtgeduffej iefhgfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 13 Jul 2021 09:17:27 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: stable@dpdk.org, Ferruh Yigit , Andrew Rybchenko , Matan Azrad Date: Tue, 13 Jul 2021 15:17:13 +0200 Message-Id: <20210713131714.964500-1-thomas@monjalon.net> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] ethdev: avoid unregistering a non-allocated callback 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 Sender: "dev" When registering a new event callback, if allocation fails, there is no need for unregistering the callback, because it is not registered. Fixes: 9ec0b3869d8d ("ethdev: allow event registration for all ports") Cc: stable@dpdk.org Signed-off-by: Thomas Monjalon --- lib/ethdev/rte_ethdev.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index 9d95cd11e1..1731854628 100644 --- a/lib/ethdev/rte_ethdev.c +++ b/lib/ethdev/rte_ethdev.c @@ -4649,8 +4649,6 @@ rte_eth_dev_callback_register(uint16_t port_id, user_cb, next); } else { rte_spinlock_unlock(ð_dev_cb_lock); - rte_eth_dev_callback_unregister(port_id, event, - cb_fn, cb_arg); return -ENOMEM; } -- 2.31.1