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 D0ABA45AE2; Tue, 8 Oct 2024 17:43:45 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9107E40DD5; Tue, 8 Oct 2024 17:43:20 +0200 (CEST) Received: from mail-ot1-f50.google.com (mail-ot1-f50.google.com [209.85.210.50]) by mails.dpdk.org (Postfix) with ESMTP id 763DE4067D for ; Tue, 8 Oct 2024 17:43:16 +0200 (CEST) Received: by mail-ot1-f50.google.com with SMTP id 46e09a7af769-710de2712eeso1955820a34.3 for ; Tue, 08 Oct 2024 08:43:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1728402196; x=1729006996; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=v8Aok7msKv3e47qbX+0n/i5gaFzOgWTvqMZUsJlTOls=; b=EVj2shEymtmjdrKTWezJm1w06eTvnh+785UVYIzkrLfgwIMlIwVOnxsCE7low82MBK xCeCGisTD7KeYq3yACCyuVcJny4n/eP0RF7GcDkhupA9ZUrKmRDX5qRgqnvGrOz/yGSv frRYyqWyV7VQ4tMa8Slqc9Vp5/F+/se53EyGIDR2MughWL3Wm8JM3MSx4Ok8BwxA9DIt bkDeSLX7avGevdXQTT4UQpRwldCiuPuZUrFYUNq9iNs3FLMbj2ojvsxEzGDKBgnX+FiH 3k+wCmCE6efAeMDmrm9bpGawbRXruDVZeJ65KK83S5iv0Rwa31dLolNrf0CeOPJhdUrt NLDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728402196; x=1729006996; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=v8Aok7msKv3e47qbX+0n/i5gaFzOgWTvqMZUsJlTOls=; b=Hw0gLE7qS+MFrNmhuYd/ycXDoH9GuhiFNPy3swpfk27Eu2xdQ8kBnFiKE0eqo/2j/5 JP0NlJf8OY6E/+60gjSd/GDe6niiUe0viCFThOt+WIzSN4cT8YTgcx66rTXcpO/mnqCl xn6JtxuHN9Bd9jOyN4/LMh26AxrxkHze+2Z5J+Duq089B/fc3HAsJwA6FNXp9eYPAvUC Kpg8ytamDGgirqUBBxLksg70EemqlLaKYwNlgI0LaG/zLD/Z2en3v1y0FR89dCNDlFq3 hKTssiySlIYyiGEgmOH5Phc0eK+dVzzCYMFXRfiPLsH/r6or0cMVkA7WjD1aKNxieLtN wWYg== X-Gm-Message-State: AOJu0Yzyya8A9y4XRUVmk4h/6DMS/eUIPOudk3ZhNQwRpCSrhb7g+n2L vOqvuuyPFaEuO3G7hVaZHmROMqSkzA65btnaBZfLf3ho+KL4PMnAhRPNom7GHbK1emGHNv5tBn8 zYqzViw== X-Google-Smtp-Source: AGHT+IFnXkZPaIjQcgMCu23ACjeQadvUjBxWsG8VAIM5iAdHBkxZXgSsYJgUvJkDcgZwm1+fY8t70A== X-Received: by 2002:a05:6830:3110:b0:710:f223:3e32 with SMTP id 46e09a7af769-7154e82b8b9mr10661722a34.10.1728402195708; Tue, 08 Oct 2024 08:43:15 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71df0ccf01dsm6293527b3a.70.2024.10.08.08.43.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Oct 2024 08:43:15 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , sthotton@marvell.com, stable@dpdk.org, Pavan Nikhilesh Subject: [PATCH v8 04/17] event/cnxk: fix pointer mismatch in cleanup Date: Tue, 8 Oct 2024 08:41:34 -0700 Message-ID: <20241008154301.66192-5-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241008154301.66192-1-stephen@networkplumber.org> References: <20240927204742.546164-1-stephen@networkplumber.org> <20241008154301.66192-1-stephen@networkplumber.org> 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 The code to cleanup in case of error was passing incorrect value to rte_free. The ports[] entry was allocated with rte_malloc and that should be used instead of the offset in that object. Fixes: 97a05c1fe634 ("event/cnxk: add port config") Cc: sthotton@marvell.com Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger --- drivers/event/cnxk/cnxk_eventdev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/event/cnxk/cnxk_eventdev.c b/drivers/event/cnxk/cnxk_eventdev.c index 4b2d6bffa6..08c6ce0c07 100644 --- a/drivers/event/cnxk/cnxk_eventdev.c +++ b/drivers/event/cnxk/cnxk_eventdev.c @@ -121,8 +121,10 @@ cnxk_setup_event_ports(const struct rte_eventdev *event_dev, return 0; hws_fini: for (i = i - 1; i >= 0; i--) { + void *ws = event_dev->data->ports[i]; + event_dev->data->ports[i] = NULL; - rte_free(cnxk_sso_hws_get_cookie(event_dev->data->ports[i])); + rte_free(ws); } return -ENOMEM; } -- 2.45.2