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 DB9ED45A50 for ; Sat, 28 Sep 2024 18:48:37 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 17F044065B; Sat, 28 Sep 2024 18:48:36 +0200 (CEST) Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by mails.dpdk.org (Postfix) with ESMTP id 0B8DA4027A for ; Sat, 28 Sep 2024 18:48:30 +0200 (CEST) Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-205722ba00cso28938205ad.0 for ; Sat, 28 Sep 2024 09:48:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1727542109; x=1728146909; 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=GPudUOheP8xEsD1/veltw/AIvXKZ9fAkLIslAR06VVHhmICcV9W0s2PNgWhOeDCxbQ SqjDZuKsGscGE+Y1E784Vco3wwvYKKEaNe68wT/Rv7h4k38QIq7RvIcBD0xj1Ve86Igc F0w9YdD91tZZPCsB++1kJ71ykoun8uMh6V4hd/fpuFONtt6voXf6a2sIkm2jY8cgJdK4 3rFj+Bj4y9EZPhDBHj0wocNrumENNsYROUf4r1XldpUxegpbdProb555cXvACKrUjRGt 010YdwP6dOtKb2Re03G5rzyt5z7gvcYm+4SXXqxtnRXq1YHk6BM+dsFBgMGfrDIoMFet pIhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727542109; x=1728146909; 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=LzEj6rZpfaQAOiRE42SHQAKLEeBswRyftIB3miUQXrBsN9pS3/ApDY8HdGvnxGMvVq gcbYgyIzWaFWsXSo5JVFD61y23BCFEwRWd+twg2RBhAvaIRKVvcW9NROlJfIoDhyY5Kq qBAC3h9uMrBrioh4ZErrVhqrosI0EQeMDXacutq4YIvsXk1vCMcwntWvU4vaHnxtqUCe a1ZxMkJjZHtzYZxUnulRh3qToIy5QTFvltVVYob4G3xBb56U/bML2GsZ9giVx9qp+mq/ DsNwMGGMuHGJr5IDIRmuL3PFa5128C4Wic1a9xmYxFmvMIxKyFsmGL+g4JNviPXwTDaf 8vCA== X-Forwarded-Encrypted: i=1; AJvYcCXFMUutGg0nYASTpNFi5Z4YPXvZqyjz1cjvedYr8tuBzD/jR7N8/6qPHnHVKFNaFzlutwAHZeg=@dpdk.org X-Gm-Message-State: AOJu0YyJ5qMOpujVUxhyp9BXDOXmegaa3A9Ne7WWO7QnQ26J2x4vSd7Z D2YuIlVQ8rm7dU5LcihJ3spyVUfv1lptev5Ab+3kBR4UjM1Dc8vfYU9+eXOKGMg= X-Google-Smtp-Source: AGHT+IHzDrARRgZsh21qYFZ7zmTv99y2H8mFUdRiJnKSkVBhqi0cwH/m0YhGcFGZuxJqmQYr72GiRA== X-Received: by 2002:a17:902:db0a:b0:205:5f35:80b6 with SMTP id d9443c01a7336-20b37bcedc1mr105261305ad.61.1727542109213; Sat, 28 Sep 2024 09:48:29 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20b37e47c7dsm28854015ad.216.2024.09.28.09.48.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Sep 2024 09:48:28 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , sthotton@marvell.com, stable@dpdk.org, Pavan Nikhilesh Subject: [PATCH v2 05/16] event/cnxk: fix pointer mismatch in cleanup Date: Sat, 28 Sep 2024 09:47:13 -0700 Message-ID: <20240928164814.861933-6-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240928164814.861933-1-stephen@networkplumber.org> References: <20240927204742.546164-1-stephen@networkplumber.org> <20240928164814.861933-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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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 --- 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