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 9FC0E45A5D; Sun, 29 Sep 2024 17:41:48 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B7EFC40616; Sun, 29 Sep 2024 17:41:27 +0200 (CEST) Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) by mails.dpdk.org (Postfix) with ESMTP id B0408402D4 for ; Sun, 29 Sep 2024 17:41:22 +0200 (CEST) Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-717934728adso2741094b3a.2 for ; Sun, 29 Sep 2024 08:41:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1727624482; x=1728229282; 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=YQhK5z5JhHG2lBdnz4X3Uc2Dx9VJV1rB6PW6zQay35M6ppT8YxGAA0Wbel2y7qcoe4 HKbbPyE+biBUOB/z329ZcoODdBib/l0oVCcfmWewwiwpE6cOHN+MLX0wAUNJH7XmOe9Q YrdFkuMoOBDHPPbjXtQEMIa2TzL7VT3d7vcZEpHMTAvyROznJkKBUUf85Tz50WPmL3cG byonzev/e94IbYgXr3+fAs6sYGzALBr4xIApsAigHe5/ApY09JEgFmG8qBNaGIJqrPCh Nj0nzirzldXdDMhoOy9Qq/LqWVAmy27L18Mj4ujw6pTNoxYL15Jmwsfp7IZtW1kgKp/u +iHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727624482; x=1728229282; 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=tbbdiOs5aRBpZznr+QOJKb8DsuSppcQwRm5M31pMkwspx9DWkUYNnVR1M56hJ8RzqA AT8Uz3Juku2I3RmEGn4s2QjadGY77KKVOQo4O4cADtE/dtC8IOmi+CzBQ04/BkAuompr h3/OciNC2rgWac1DR9YrBm6Xkdn1Pq6/WokgVP7ycn9UlOrOM6UVqZbJhsg2z3v9M7+L SKYAAb3Kq8B8y2DlKjYFEZoVThh8RJCBkQlmtnqFzcaoa2fm4V2Noea9Hqir+OgvlLo5 XxxNfSr9rvHIpsbZxk0NON30u/4tE1SGhq8KSoPy354GsQw84GybIulBNe8Yrx3GIis+ Ueyw== X-Gm-Message-State: AOJu0Yy+IHb7Ugt3b2XBEdQfoX3spz4nLU58kT7HP5di+C/oaoEyHmQ/ /gjuzZGe/9/8uS22HrZ8jtdLkNEvFrWTmvDrJzQMHi45w7ub4DBd2jjPTP5KCQuj6qSlEfqoRSV XJ5M= X-Google-Smtp-Source: AGHT+IGzfSO97TRY0eDQaA5QnPvsm2cMyPQrpFeBtYMrvJVy3E697jlw4/aHG5RiFztWrwBX9vuVyQ== X-Received: by 2002:a05:6a20:cf84:b0:1cf:476f:2cef with SMTP id adf61e73a8af0-1d4fa7d4616mr11352586637.49.1727624481919; Sun, 29 Sep 2024 08:41:21 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71b2649c775sm4707416b3a.29.2024.09.29.08.41.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Sep 2024 08:41:21 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , sthotton@marvell.com, stable@dpdk.org, Pavan Nikhilesh Subject: [PATCH v3 04/18] event/cnxk: fix pointer mismatch in cleanup Date: Sun, 29 Sep 2024 08:34:29 -0700 Message-ID: <20240929154107.62539-5-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240929154107.62539-1-stephen@networkplumber.org> References: <20240927204742.546164-1-stephen@networkplumber.org> <20240929154107.62539-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