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 5C14F45A5D for ; Sun, 29 Sep 2024 17:41:32 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 16B3A4064E; Sun, 29 Sep 2024 17:41:29 +0200 (CEST) Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) by mails.dpdk.org (Postfix) with ESMTP id AF105402C5 for ; Sun, 29 Sep 2024 17:41:22 +0200 (CEST) Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-717934728adso2741095b3a.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=E3qDjxJEegkTVX93VIqWIp7dk27nIUM9Ziq2Ct/ybAYJRSR1aSvmWb6wq83D7vlSDi DQKFmfnrmXidpvk+ZW61wuL64+41MUAYJRQNFnbu5+/ro7fOcWhIx6+UwqT42+H8DCB+ jqn4zE6lj3q5jpZRUV2TopuAYUS0OOqo4TfCJnudrSK0wtHrlwVnArZYFSkjWAMuJMZr bGJnaQ4rb7nb+he50sDkZz5U5SNjN101fVH6GHhxTTFDrEe9VmBYDVP6/gf/8MEB/8NH ly0Rg4iZE8Lo2IoWIU3unC7+c3Fc0YOxCqnqOVCfH69hmaFacj78P5fLicv+1JrEGY4m aCWw== X-Forwarded-Encrypted: i=1; AJvYcCWMZh0GVH0V5O4WpysD/Zdx/Jedwgk1peDm+Dmb6LpKowVPpJlRDmH/5qmq3r/FQXeA+KJMq6w=@dpdk.org X-Gm-Message-State: AOJu0Yw+2vcPPb5DELwujruXqRiamtSowvqhExXVtBJDsptlmVD8/SnU 3vPkhNThiJYLT4IJAUOamYuDFhLR1MgUnLjUZe9yC3yB4eHm7td7MrTKm+iyoWk= 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: 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