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 8055445AE3; Tue, 8 Oct 2024 18:40:04 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6968E4021E; Tue, 8 Oct 2024 18:40:04 +0200 (CEST) Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) by mails.dpdk.org (Postfix) with ESMTP id 262954014F for ; Tue, 8 Oct 2024 18:40:03 +0200 (CEST) Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-71df04d3cd1so3379550b3a.2 for ; Tue, 08 Oct 2024 09:40:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1728405602; x=1729010402; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=PYmpswVRRcVlnxidv2mHG9Hvz95qqjAnNS/FAJSnZ0I=; b=rOMYAaQ2IAevCuToJF/ejT07xE0CygNMsrRjfgZWsz63r5k3NVpGin0YZMBY1GivYa vWuqGWvkN5eGhpg1WGHWMQF7Wwd0jyCErwwGjXoECFQIjWdppXondeRUKI3xTbkkVzxV jVRpwWyiBmb3gFQN5eTiQtftLrMseepgVzvEJOtsPZVq9Ap6C3ibR9XxkMgr5PEpgCLc GEhrQM47XuOn/g5JhOvl8JiWyaIXH5Yn8k4lhxc7ohI0+yw7UuJkC18pi5pyzJ1v7eA0 FTlV7YyA+OPE+39sOui9PIa1LwrUfD5Hz7gMnyB+I/6EnaaJRSDs8c0Q/xiS9ev2zwq+ JJCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728405602; x=1729010402; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PYmpswVRRcVlnxidv2mHG9Hvz95qqjAnNS/FAJSnZ0I=; b=lSwZWvO+HcjaoduezPHRQziYQZ1yYErCrTkEPPXNndK7/c3mMDBu+B1CfrcZt2HPVr sX39ESSnP1tx1eULV3ZAxkIUqmbgmgSZKh6fHZ1ogPQj8Cj1OZZzrRuSVn7MgLp/LHK2 1uc5IgY3IqzHhyPKXEAdaxRfkkS3VC3HUDa4Qe6p5c9UEMKIAkRH+JQY9/Vq1NupJWRE yZJxl5KyjwPJhHPF4BpEUt8s5nNfaJMTWOGahhJzRZeuSeP4qjJGubOubpth+qJYQwPV NALynDBPkdpOG1gTpqcbBA/2CbqyJ8YlmohRyKrBNJ8+HVjB4Wm/OlPFLg8xWGg0/ci3 FZ1A== X-Gm-Message-State: AOJu0YxTkILjH5+e3giroZbygYSX90mxpnq6LBqhsilIIMSwDe8vbqYC qkn7rarvYUIKoGPq3hcdcaqp5DnAf7GHUNag/LHMeQFo3UE63xiPu35/AFpHbaXifD+JVNdsBXV RtnPvCQ== X-Google-Smtp-Source: AGHT+IGY10SLoeg1cVAC7hpkwsvtE4926h+Nid1XCwQwnL3N/xzRX4TLMKPnlgNrIzpW7zLrgyeTDQ== X-Received: by 2002:a05:6a00:3c88:b0:71e:fb4:6c98 with SMTP id d2e1a72fcca58-71e0fb46e9fmr6855270b3a.23.1728405602325; Tue, 08 Oct 2024 09:40:02 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71df0d62376sm6577031b3a.141.2024.10.08.09.40.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Oct 2024 09:40:02 -0700 (PDT) Date: Tue, 8 Oct 2024 09:40:00 -0700 From: Stephen Hemminger To: dev@dpdk.org Cc: sthotton@marvell.com, stable@dpdk.org, Pavan Nikhilesh Subject: Re: [PATCH v8 04/17] event/cnxk: fix pointer mismatch in cleanup Message-ID: <20241008094000.73da39d9@hermes.local> In-Reply-To: <20241008154301.66192-5-stephen@networkplumber.org> References: <20240927204742.546164-1-stephen@networkplumber.org> <20241008154301.66192-1-stephen@networkplumber.org> <20241008154301.66192-5-stephen@networkplumber.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 On Tue, 8 Oct 2024 08:41:34 -0700 Stephen Hemminger wrote: > 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. >=20 > Fixes: 97a05c1fe634 ("event/cnxk: add port config") > Cc: sthotton@marvell.com > Cc: stable@dpdk.org >=20 > Signed-off-by: Stephen Hemminger > --- > drivers/event/cnxk/cnxk_eventdev.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) >=20 > 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 *ev= ent_dev, > return 0; > hws_fini: > for (i =3D i - 1; i >=3D 0; i--) { > + void *ws =3D event_dev->data->ports[i]; > + > event_dev->data->ports[i] =3D NULL; > - rte_free(cnxk_sso_hws_get_cookie(event_dev->data->ports[i])); > + rte_free(ws); > } > return -ENOMEM; > } This fix is not right, but something is wrong with the original code? [865/3024] Compiling C object drivers/libtmp_rte_event_cnxk.a.p/event_cnxk_= cnxk_eventdev.c.o ../drivers/event/cnxk/cnxk_eventdev.c: In function =E2=80=98cnxk_setup_even= t_ports=E2=80=99: ../drivers/event/cnxk/cnxk_eventdev.c:125:17: warning: =E2=80=98rte_free=E2= =80=99 called on a pointer to an unallocated object =E2=80=9818446744073709= 551552=E2=80=99 [-Wfree-nonheap-object] 125 | rte_free(cnxk_sso_hws_get_cookie(event_dev->data->p= orts[i])); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~ [3024/3024] Linking target app/dpdk-test