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 71D0845A7E; Tue, 1 Oct 2024 18:37:50 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1B06840684; Tue, 1 Oct 2024 18:37:28 +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 F32364060B for ; Tue, 1 Oct 2024 18:37:22 +0200 (CEST) Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-718d704704aso4829246b3a.3 for ; Tue, 01 Oct 2024 09:37:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1727800642; x=1728405442; 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=cRDd8cnuwvalgAb2TPRhMeFzJtsEFe2DiaLgJjer/HaYs2SQmmdZDoqSzAnxXf1b5R FbPw6t9KO+M3l7cdZbFsMN74Uw56tJ88IyIF46eaLv641Vlu1dpfF6S3jHvmKeR6pb/Y iIsG7jt49SEXngCxb7D43tjCUqsdXbRKSV7e1g2yzDOUKDKWVljvUfI7d/k9pq1VOL/I x6xNmKbA42Jlsot0AnDLbCdLZt0ZunYa4XZsOxlTVyLGq1vPG9TfFhDxDgp8ouy1huho kfCNf2orLjw9SA+aP+coix+tJZXdBt5SbdnfOyAhL5iWAUOJUtQXqMOSD17WdPk7n5z4 8zCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727800642; x=1728405442; 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=aoI7JM/RBcqIygvmreyLsrYke6ZXVenoM25q19opNj1V1blI9dKykYN+FJcNmzzaRR wMjpZTKvhO2itOu9s63uTk9XaXDbxy8pV336TWsZRDfa4yeBEuqNOj1HnmF9NSgo9uti ck5O20i0I4jiZCT2fZ6dF/tVHya4qBp3c4Tf/fxhrTwDqI3fD8tfqBw8yhmRVummGTWG XHDo+BbOBwudBz8JB8GkM9p/a+VWEWXY89+if2jn3Mr5kHeSwynw3Phg7cIffg2ioqsI H6y06T0WSQ+cOTtViLjX5W9ZLE4zN34V69+8Sqy/1LHBVyw1ayrEoP186DsgwipAi0f9 D3RA== X-Gm-Message-State: AOJu0YyY+/4Hfr/mKSxfYYv8QwPG0gUiWjtpaEksfer50/iZqF5gBBAQ UBDag5x1jKCdL0T3y9vF7GfNXRkQ/typaqo87aEznQVLlZPUcj5p4PwJ1Bc2kyDHFIA4sl6mpgk fHNo= X-Google-Smtp-Source: AGHT+IGTfsRbces2wPSxaSygFJoOTDfPoi6DFg5daZKwKNlwBcM0cMBkCewF6p0Jz/mmWzW239VWOA== X-Received: by 2002:a05:6a20:c996:b0:1c4:23f0:9665 with SMTP id adf61e73a8af0-1d5db19264amr493879637.29.1727800641988; Tue, 01 Oct 2024 09:37: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-71b26518818sm8213565b3a.129.2024.10.01.09.37.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Oct 2024 09:37:21 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , sthotton@marvell.com, stable@dpdk.org, Pavan Nikhilesh Subject: [PATCH v5 04/17] event/cnxk: fix pointer mismatch in cleanup Date: Tue, 1 Oct 2024 09:35:27 -0700 Message-ID: <20241001163708.355128-5-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241001163708.355128-1-stephen@networkplumber.org> References: <20240927204742.546164-1-stephen@networkplumber.org> <20241001163708.355128-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