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 AFB4E45A9F for ; Wed, 2 Oct 2024 20:39:39 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 422A64066C; Wed, 2 Oct 2024 20:39:37 +0200 (CEST) Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) by mails.dpdk.org (Postfix) with ESMTP id D78C040614 for ; Wed, 2 Oct 2024 20:39:31 +0200 (CEST) Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-719ba0654f9so154737b3a.3 for ; Wed, 02 Oct 2024 11:39:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1727894371; x=1728499171; 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=ym9l+Cuc82L8UU1shNp/+w8hoXgcLhXQbjvwSdQ80VuD4OqbA/07eQFlVFWmhn4Fu2 3b2k5oGR0CaAQrkjAqdtiAEXhttY9jIEE/o+fATdfg7zZYnoR1yG1KciizjBV+VgeCvZ mB05qPJs7nZOvpkxhjeqvuVaq7tn5C12ofcUIKmo7SDKnafthmQDKOcy16MJjJAsI3va nHHRP3WlJznkUPTwLi7+QPZhkylkl6CLs4lWkPgNEDIuQ0bWpnENuG63J/9jFHwmcPjG mKTcoHYJbPhga1iCk3gsM1SeE6vh/hmUcdCDsJ/LQbEgvU7ymv19bWh7HxkKoGtWs5Mk 6W+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727894371; x=1728499171; 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=hZccWjUxCN1I2Tpjrbwo/hTnyuvHpWU/IPrJSppDb7I2SNtr7+v1zBHMaqgGkvrMaY Z4DxtjKy4/Pj0hiNuuP9AFlNDtTGYKzhWRnbgWVsQd+UxQh6qwA1TnM4cSHxWIiF06BU MqNfWFjXwYlgVTpgr3svHwmMUrZ8/Mf/FzMhkYZ/78l1crE4Lwup9whxhh3TDAL+8F56 hERErNjh5DLEod9iKM9YJDTHAr7jaH4yr3C7ytURv05KqZX84wFsIPauVfuMa5jnfYGK fYWP4hEfIhZD+ZohnMBHOKFrb0xJVl7ACbFbSvJm8/b9PDO9H1SAkFIU3gqKKpaJzcbf ie8A== X-Forwarded-Encrypted: i=1; AJvYcCX7N5R4xMZmOYG4JNg9FkDC8ABMOz/igLdeThJwnrDujEvXPGjfiOvFgo6yiRMHBRDCOi2JnwQ=@dpdk.org X-Gm-Message-State: AOJu0YwFskfYLWB+5pDNCRlYEVWcwe1zC8imJTfOPj3pyRRL1w4Ml+aH 8QPmy0js2SjtvZXKiHSw8aoQWN//wdJTTcIKQaA0Se7Scnw/oCK2O36gi00+2tokFh26514RIac V X-Google-Smtp-Source: AGHT+IE+broqQRycez92DyC7gEt89QjxRZgGP7DZQTb8qz2fJk+2xkt4ZLYCayO9hIGn6WekvQ2hTg== X-Received: by 2002:a05:6a00:2295:b0:70d:3938:f1a5 with SMTP id d2e1a72fcca58-71dc5d53280mr6083072b3a.22.1727894371094; Wed, 02 Oct 2024 11:39:31 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71b2649b0bdsm10104362b3a.34.2024.10.02.11.39.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2024 11:39:30 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , sthotton@marvell.com, stable@dpdk.org, Pavan Nikhilesh Subject: [PATCH v7 04/16] event/cnxk: fix pointer mismatch in cleanup Date: Wed, 2 Oct 2024 11:37:42 -0700 Message-ID: <20241002183918.161656-5-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241002183918.161656-1-stephen@networkplumber.org> References: <20240927204742.546164-1-stephen@networkplumber.org> <20241002183918.161656-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