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 79B9645AE3 for ; Tue, 8 Oct 2024 18:43:19 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 743CA4021E; Tue, 8 Oct 2024 18:43:19 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 3DCAD4021E; Tue, 8 Oct 2024 18:43:18 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 498A9nvf022930; Tue, 8 Oct 2024 09:43:17 -0700 Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2175.outbound.protection.outlook.com [104.47.58.175]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 424vg89ky6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 09:43:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=boV+TSiPJInKDZmBGlIwIVRMSwKY6WREDDD2X7Gy+SzcLwdws9Wne0u7gcw57OOUv/6BqP2CFvWi0LFxU5mrhfCZl7yqkOUVaREC5LOoJHetlNufDM+Kkw06aFK19vDJZ4zVA9tNM6Zt0xfX0gAKfXBm/zkwoZ0ZmFwMdg4q3fVpwJx3fWiaz+HuKPcDv8CVH1lRLucIVO90QTfyrsscETW9tTOpBjdLNretm6wJvALq6J36PZhgH2D/mepVBN6Y+8wWM4clMixTbynhvmKaPHCjGchluLiL84DGCl9kfAfgCQ5i9UOXZe3NhT8A1+yb0l5G9jOdyhyAAwEUxY2sVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=opJRfYcLrrJHKOX1dcXK2Uxt5jBsYHXoK4v+SFEy1IY=; b=R2I3Y7sz29CtStMc1U+4SV2Au3VDeDUYEP5U2oLtyIx3u4sk38MvLN1TIHL7h33HW/9zGQdtKuv7vGyT8AZZneGFSxaZd3oTWno2b6/BbCFzM2LS9Dv3HUxjK9roymhBFtJLeJT3XiHC6d6qlHsWgG42dUP/pBWM9iF2wBopUKcWIRzPkb09IcfhkAkTdTYpSh3E5v2NCmkT9syJkLXlNAIE/gnTPZF7JWciav2kMCe7ipL1iuSGJN9z4QQvcILWaG4lNzcpNvcL0L3RRO4SwN6tz/UExZQ0KhE7G1z+je4MYxA93wZAu1N5+PMeiaHFo5QDl39pWO0N+1+vY02MPQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=opJRfYcLrrJHKOX1dcXK2Uxt5jBsYHXoK4v+SFEy1IY=; b=voIRRQG/w2V0n9TLJiWpEasC3wmoZDA3eThmhn0LWWa65QqJOHfC0UDUgsaJBE8xs2pVlWXx0WxqbI/dBpCLZC4nm7OlYwbdUGFO4plP7WUXsC7SGN43CX9nb7dGKA/tCReQFR31l+OsC57FCmAQ1buO7IsUojZhmyPQ20EoOuw= Received: from PH0PR18MB4086.namprd18.prod.outlook.com (2603:10b6:510:3::9) by LV3PR18MB6290.namprd18.prod.outlook.com (2603:10b6:408:26c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.16; Tue, 8 Oct 2024 16:43:15 +0000 Received: from PH0PR18MB4086.namprd18.prod.outlook.com ([fe80::ed37:4ea0:6359:f717]) by PH0PR18MB4086.namprd18.prod.outlook.com ([fe80::ed37:4ea0:6359:f717%4]) with mapi id 15.20.8026.020; Tue, 8 Oct 2024 16:43:14 +0000 From: Pavan Nikhilesh Bhagavatula To: Stephen Hemminger , "dev@dpdk.org" CC: Shijith Thotton , "stable@dpdk.org" Subject: RE: [EXTERNAL] Re: [PATCH v8 04/17] event/cnxk: fix pointer mismatch in cleanup Thread-Topic: [EXTERNAL] Re: [PATCH v8 04/17] event/cnxk: fix pointer mismatch in cleanup Thread-Index: AQHbGaC8FUOUxv+2p0Sx+TLQk4kwOLJ9Ducg Date: Tue, 8 Oct 2024 16:43:14 +0000 Message-ID: References: <20240927204742.546164-1-stephen@networkplumber.org> <20241008154301.66192-1-stephen@networkplumber.org> <20241008154301.66192-5-stephen@networkplumber.org> <20241008094000.73da39d9@hermes.local> In-Reply-To: <20241008094000.73da39d9@hermes.local> Accept-Language: en-US, en-IN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH0PR18MB4086:EE_|LV3PR18MB6290:EE_ x-ms-office365-filtering-correlation-id: b09b0b5b-1dd2-46a8-00db-08dce7b84dac x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|1800799024|376014|366016|38070700018; x-microsoft-antispam-message-info: =?utf-8?B?eEpwYU9TZjJJY3hRRHhsdElQYmFGRUEzUk9BZnNnVVVRdHNqWkdKdmo1Znow?= =?utf-8?B?QWZNU3pMeUloN3NJMXZTZ3czb3dnQXNFYWtXZFhPd0pLb0RsMk5SR1Q3S1lk?= =?utf-8?B?a2RjVjNvV05scXdhcmJrSU8weGdxSUtmaUtaMDdhOHJFai9FK0lQY1h5NzIy?= =?utf-8?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?= =?utf-8?B?K0JlelFKTnRWaTNRV2JqeDhRNXM1MzdtYjlIQkllbkdLbkxxclgzOGpJNUZN?= =?utf-8?B?bis3bVRLMEJYWHZ5b0pqa1MyYTJtb3dmeG1OaFhwd2xscTNsUmZzSWk3WGhm?= =?utf-8?B?cVd6THhTL1VISmJqdkVBVStrSndBZ0NlZWw5NjE2UmRHbUd3Z3pPdkJaQzIw?= =?utf-8?B?MnJNSFpWTXZtdmpLYU5lSDMwOFJhSVBoN2xVNTg5ays3YmJrdmJRZlFjeXNX?= =?utf-8?B?cWFDOGVnM1VkM0l6TU1NVlJGaTZsdnIrZ0tKbVZWejQ3M0p1Qk5pR3EwWkN3?= =?utf-8?B?c2ZYMGFGUm1mVFdnUUlLMzhFQ2V5QTZac1JqNlZ2VlZBWUlsWlBURUxkZVcr?= =?utf-8?B?QVFDZzRMaHcrSWtSNFlQdnFrVHZ4VHNBangvdlZFbEVZM1R2Y0xoSFM2ekpl?= =?utf-8?B?SDZsb2d6b0Mvc3kwWWZsRnZUK0lnM1FTUENnWmZvSUhXTnFYdWxxdGtKc01H?= =?utf-8?B?MGZOWnQ2RzU5Vi9XdHNUZkowMVJRK0ZWR25GVHpwNkoxNEdlQXVETzJ1U1Ry?= =?utf-8?B?QzNMYzcrYzZvVWhUQkJpVThFcDB0b1h5SXprbCt3WHVuM1Q1OWFCbzJ6aEp1?= =?utf-8?B?Mjh0OCtYM1RBREpDRTdjcTdQOGVaZ3NMK2FZWnhYc2dtUjZTMHVxNjVobXBO?= =?utf-8?Q?OPOHQRTeO2MQDBrUVs=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR18MB4086.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(376014)(366016)(38070700018); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?a3hTNjd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UZ5?= =?utf-8?B?L1hIeHhuVUNZMm5RZml1eEdYcHNMbG9yMDRIVkRVaFdBbFc0R1V1dVVUbm43?= =?utf-8?B?SWdFTTJlTFI5QlNYcU1nSXVUUUdJSG9qdDhYOU9QeVhDOEVTSTZ4MVZVZTdy?= =?utf-8?B?UlMwNlZQK1dRS05NdjVMSVVrOWRkUmN1WnNCRzR6bVZpQzdZK2duSmpFSExT?= =?utf-8?B?NHBCVnBJWHB4SWdHTXhjcVhONVIwMS94RTE4UTQ5VG5tZU03NEVQekVQUTgx?= =?utf-8?B?ZDVkUTdYelFPRjA1Z0lPT1BOYUF0bVIwZmxtLzQ0Vk02TjdibnZkcWlnNnlH?= =?utf-8?Q?yB8Evj9m7Km5yyCILHfcQp06R?= MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR18MB4086.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b09b0b5b-1dd2-46a8-00db-08dce7b84dac X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Oct 2024 16:43:14.2779 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: U88C8YsfHP8nocN5/DsJBaw4ZFpqHJ0J+QQ3fO6wR0PzBFFBGsU4RMSKTegWVcAgmh7hrT3sanWbkEegPHtwnJ5yJq+T+5pd8ZBmqENTXLI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR18MB6290 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: Fvs9meSj0m1I_uTWKx2PSZbsVFrWkC1l X-Proofpoint-GUID: Fvs9meSj0m1I_uTWKx2PSZbsVFrWkC1l X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 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 > -----Original Message----- > From: Stephen Hemminger > Sent: Tuesday, October 8, 2024 10:10 PM > To: dev@dpdk.org > Cc: Shijith Thotton ; stable@dpdk.org; Pavan > Nikhilesh Bhagavatula > Subject: [EXTERNAL] Re: [PATCH v8 04/17] event/cnxk: fix pointer mismatch > in cleanup >=20 > On Tue, 8 Oct 2024 08:=E2=80=8A41:=E2=80=8A34 -0700 Stephen Hemminger > wrote: > The code to clean= up in case of > error was passing incorrect > value to rte_free. The ports[] entry was al= located > with > rte_malloc and that >=20 > On Tue, 8 Oct 2024 08:41:34 -0700 > Stephen Hemminger wrote: >=20 > > 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 =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; > > } >=20 > This fix is not right, but something is wrong with the original code? >=20 Yup, the NULL allocation should come after the free=20 rte_free(cnxk_sso_hws_get_cookie(event_dev->data->ports[i])); event_dev->data->ports[i] =3D NULL; > [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_ev= ent_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=9818446744073709551552=E2=80=99 [= -Wfree- > nonheap-object] > 125 | rte_free(cnxk_sso_hws_get_cookie(event_dev->data- > >ports[i])); > | > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > [3024/3024] Linking target app/dpdk-test