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 AF89745A50; Sat, 28 Sep 2024 18:48:59 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 430654065D; Sat, 28 Sep 2024 18:48:36 +0200 (CEST) Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by mails.dpdk.org (Postfix) with ESMTP id 093E540273 for ; Sat, 28 Sep 2024 18:48:30 +0200 (CEST) Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-205659dc63aso29492805ad.1 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=tAM8mcMzGKO0qGuM6pm0b8wljNH7K772BkMfiDsDBaUO/8ITnuKCce/8i2DeEKEXSq pHTWYMZYAFGeJXz0+7o1x5fZ2fGMZF6UZuId+pkt5M0nXC0xNFOVVB/wgUEFK1Jl+egJ 2hmh90oGTrmpwtorO01zGKv4UoqtpiA7nPCm/fNZSSd648csBKwRv0tuGfT49ylG6abU v7ob35vk1jZT4d53/HN+Ex8oUHiA0rW5PsKyTTd33udTttNQoX+gW15lQO4EY7Ai61sj jfphY/w/UPAgcS8TyMqBJcZRhZyk1v38ITp3oyxN1j/7bw5q+cmkrTpXitRU1/mZtAgZ P9Ug== X-Gm-Message-State: AOJu0YzSku09DnedJZh01CtE4Mo/DAaOcducF9NcD52vpX8RmD+SIoDE 33/etOzqAhpl2U4FZ4GSfI1ZPRQbhPXsEhW+8/61nzbMGCrsZJ0yzAPgAU94d/gPZOYL7qybuHN I 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: 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