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 A5BB445AE4 for ; Tue, 8 Oct 2024 18:40:05 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 90C9E402BB; Tue, 8 Oct 2024 18:40:05 +0200 (CEST) Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) by mails.dpdk.org (Postfix) with ESMTP id 27A154021E for ; Tue, 8 Oct 2024 18:40:03 +0200 (CEST) Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-71df67c6881so2899935b3a.3 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=FbRUCWiI7H847uhCNs/P2IY1KThx12F1e3syCj25MNYKVXAHHt8ea06rUM+en1PfRM uor5WmRIbJWYFHrVCK4VRTCjvb/1De3n4EfxKO20psIVrBb/H8KCfY7434Y9X6jbUCpT aviKs7pKCtAAez2gM1OSvQIMwFmks7VURHzYMJInxVz+Fx2G3okMffXz+zCYtGO7AuMN VuYygdCwsqvUCziF2GrSNhpv9J5EhoTQcnzS9JNh6D//KNyRTHLWJHV1Yo/RmR1nNnZ1 hZaCGFADlINnm/0M+if8AeYkigxfHto6J9Ul1uKxmSPetnJL7kos3T88CDlm8FLPS7nC 0Uhg== X-Forwarded-Encrypted: i=1; AJvYcCU9uDrSbaXOQuS9W6u+lBhBqG/E1XeAgr6407RlJudGd9FFGWRaoH3880Up4amoybzYWId97NQ=@dpdk.org X-Gm-Message-State: AOJu0YwNpy1h6Csdm8xdV+XVD8k5jG4JSKC4KQafx3BZCndwZI1LoAlO 9bS+PDlBRepRQ+ps+upBzkoDDJcSu2Ulc4miY/0D+7zsCD1yp681yiDdMi1NuzM= 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: 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 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