From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <stable-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 31C4845A9D
	for <public@inbox.dpdk.org>; Wed,  2 Oct 2024 17:44:50 +0200 (CEST)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 58D9D40652;
	Wed,  2 Oct 2024 17:44:47 +0200 (CEST)
Received: from mail-io1-f46.google.com (mail-io1-f46.google.com
 [209.85.166.46]) by mails.dpdk.org (Postfix) with ESMTP id 290814060A
 for <stable@dpdk.org>; Wed,  2 Oct 2024 17:44:43 +0200 (CEST)
Received: by mail-io1-f46.google.com with SMTP id
 ca18e2360f4ac-82ceab75c27so412267939f.1
 for <stable@dpdk.org>; Wed, 02 Oct 2024 08:44:43 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1727883882;
 x=1728488682; 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=HeGe0Bw3vU0EA3gDgc1xhkaHIxn5LGWTH6bfqa6ypOE0fceEJ8p5CGk3w9ViUZpksP
 dFrksVZeKYpb5V5OY5VxY0oj0F0DwwHyXKuspDHeP5OtOGS/iJ/rIk7JnimglE+oHQPQ
 8Wf2ik7+KbOdeuERYcw6FjqzYYD1BAmDMKHGy4fiK6ty06cCwoqztAzE4aeo6V+2IqYz
 nlQ59wxKjUQsk+WjmK0sd8kJySTH29dEMwKlTsUWJNMG08WP8e8bDljRtOPkrcZFM+9l
 EimOHB5f5q0DHOK+th3PP3v0h2wZ5TmHXQ1ahyJIYNXQPqdDmO7L3sR81K99mxOnUxtJ
 An6Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1727883882; x=1728488682;
 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=aq7byyxid4aXh3Y0XUcuqnZlnoqW12eSzXL/EVDV9RN1z5gAW1FJHMtWxmqwwoLXdg
 Wj38OWFZ4IpC2by9cgZ+JqnaoG4oPlybGrPVXsa/Gb7OdCKQI1VqxAUmBiovtrtEqBPN
 bzzSiExV51WAQs15E2ogz5s5MJRO9+CBUxSRxNUvCUweU0odiMR0o/6bhP/FUQp9zodb
 w0sHQ3nMFonjJzKIMD+gUUrA9Nu6MYs041ON1mZqN7ov9j6S7LD0uD3cEnOb+h6QmWFa
 ib6RoD+ir3GVS/m/GGitXcd36uygxPvE3NnInCbTQf/LFHvJ3fORKVDjJMQ+kg3/rR2L
 a70g==
X-Forwarded-Encrypted: i=1;
 AJvYcCXEDDUP6Q9Z0iuIbhxXJDUH1TRGINOthmPrfFz5+uxLmgPbP4vhGynWrjgZsaVRMc/lojJifi0=@dpdk.org
X-Gm-Message-State: AOJu0YxfUZ4h3XYw9rw6KvJo/2QLvEmxJUJ1Tl56swZn4FLXDVXXnbXg
 U7x97qPFZiXZ0OxTg3OZTEcFid756mgleWqlOslBMUOEVgHTnmhpfK1X89ydQUU=
X-Google-Smtp-Source: AGHT+IGEIc5bzB0yNhpI1iRSfxggxTfYJ8hMjXt5BQMnn2oUuJ60BBLOj3OB2N1YhcljrKqEIrqUBQ==
X-Received: by 2002:a05:6e02:170b:b0:3a3:3e17:994e with SMTP id
 e9e14a558f8ab-3a36591eda8mr33019255ab.9.1727883882408; 
 Wed, 02 Oct 2024 08:44:42 -0700 (PDT)
Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226])
 by smtp.gmail.com with ESMTPSA id
 41be03b00d2f7-7e6db2927c7sm10247363a12.1.2024.10.02.08.44.41
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 02 Oct 2024 08:44:42 -0700 (PDT)
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>, sthotton@marvell.com,
 stable@dpdk.org, Pavan Nikhilesh <pbhagavatula@marvell.com>
Subject: [PATCH v6 04/17] event/cnxk: fix pointer mismatch in cleanup
Date: Wed,  2 Oct 2024 08:42:48 -0700
Message-ID: <20241002154429.64357-5-stephen@networkplumber.org>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <20241002154429.64357-1-stephen@networkplumber.org>
References: <20240927204742.546164-1-stephen@networkplumber.org>
 <20241002154429.64357-1-stephen@networkplumber.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-BeenThere: stable@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: patches for DPDK stable branches <stable.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/stable>,
 <mailto:stable-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/stable/>
List-Post: <mailto:stable@dpdk.org>
List-Help: <mailto:stable-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/stable>,
 <mailto:stable-request@dpdk.org?subject=subscribe>
Errors-To: stable-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 <stephen@networkplumber.org>
---
 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