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 7782E4567F; Mon, 22 Jul 2024 12:42:20 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1B4C440E1D; Mon, 22 Jul 2024 12:42:20 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) by mails.dpdk.org (Postfix) with ESMTP id B0FC24025F; Mon, 22 Jul 2024 12:41:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1721644918; x=1753180918; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=JKnCKgD+/uWTqGiDOMjPZulcpxl9Kh2pSLr01zKl1fs=; b=G3Zce2oBF8Cslo0Kidyi9OiEE4sU4KWSdrHWNseOOupNu/qcVqn6Czsy 66mKhGKFAA9w6ni4pW++mgNO626/CYAJqwFdNc6afnVv+uTvNn1BP/MdO QRuafNloZwH3GPYyIKbuwNgr6v5v7sq7cnT5D1t2aYPyNUFd6zl5JCYsc hJ81sb+MfEZV+hsdi4sUo2CYib3IAOJtlNByLVppOnBPSNs4eddGLaQpg KX/jxlVueSQhJCHkEzfJ+f2WVODS2sLW9A7brWjI7SHzE1pmIwCf/BWZW 60E3kM9AkvwyTqtCtj+F4cPwexZ9diqaaa3ISztTpU/ApQP9BX1CGv9bj Q==; X-CSE-ConnectionGUID: LuQgb6usSM2UXFumCncuIQ== X-CSE-MsgGUID: m/p2viznRO6bjq78LRocAA== X-IronPort-AV: E=McAfee;i="6700,10204,11140"; a="19354562" X-IronPort-AV: E=Sophos;i="6.09,227,1716274800"; d="scan'208";a="19354562" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2024 03:41:57 -0700 X-CSE-ConnectionGUID: f6tWwyT8R26NfGl6NmOP2A== X-CSE-MsgGUID: WRdwuRD+QCOwe630rhIh5Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,227,1716274800"; d="scan'208";a="82857334" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmviesa001.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 22 Jul 2024 03:41:57 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 22 Jul 2024 03:41:56 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Mon, 22 Jul 2024 03:41:56 -0700 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (104.47.73.175) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Mon, 22 Jul 2024 03:41:55 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xh5CNkzFKKzYccOH6c9pE/8c+JcklUBauy/UXqd34k56LSAEoUC0Isr5Udcy5q8WEY97p1mfaMbsou8lHmNOQKzgXXYdNmdm35m3MH5aZnVJ6zjLlOu/2snI7HaYOSxa9fWwlwtrmzCQqS0UIYYBuleySiZLpWj+/UCP3TNNXZQE77NjampUG0mq2s0g6zyv1mwqyY67dgYgRd03UEZgV5mgTOM8fCYbOL3XcpW+NSXxWWPHtHXUzwLqUwAWe+fk/m2BffbkEJdUF/lJlDSZZZeYwodBTQ4Iiy7tPontXZQ+FOGUZ5dleFTvzKow7yJ6cf5uD/+Qi7c/dGThOWeQFw== 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=D11Kw4lEJ2A5Fr66zg2qIeRty5jtWRDb/ML+Ilcxwi0=; b=EeekqQcnmXf6xRnv9+vC/OXv4zQjKuIXTlhkZAfxAVb3LuM/IzIolkAXU+JRvt7SZVqQ2eiEAgSBbvwfVT1nS+HfdxG033dDplYk7++gNhyPF02lwngTbqLRsOwIzM34zGhwPaORhgog0LyQ2FS9GF6IskNV+wxWk1J9DoSeVpl+XPxqrd4+3IHWOD4Ht4qBTNq5Vjb3APobS+jXHghAKLDM2dy/VnO0yMB82MDeBF43WTZQspsWfDcEuoWcUVplXoOGP8orz1us+FoAf6kujsTt2IU08zNRtw224z8glerumSfwdtFlxewMV1iEXY3LnpjpqwRzgadBv/SrOXczOg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by DM4PR11MB6216.namprd11.prod.outlook.com (2603:10b6:8:a8::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.14; Mon, 22 Jul 2024 10:41:53 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::f120:cc1f:d78d:ae9b]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::f120:cc1f:d78d:ae9b%7]) with mapi id 15.20.7784.016; Mon, 22 Jul 2024 10:41:52 +0000 Date: Mon, 22 Jul 2024 11:41:47 +0100 From: Bruce Richardson To: Vladimir Medvedkin CC: , , Michael Theodore Stolarchuk Subject: Re: [PATCH v3 1/3] net/ice: fix possible memory leak Message-ID: References: <20240715180441.3682734-1-vladimir.medvedkin@intel.com> <20240722082836.176515-1-vladimir.medvedkin@intel.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20240722082836.176515-1-vladimir.medvedkin@intel.com> X-ClientProxiedBy: DU7P195CA0019.EURP195.PROD.OUTLOOK.COM (2603:10a6:10:54d::32) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|DM4PR11MB6216:EE_ X-MS-Office365-Filtering-Correlation-Id: 75c904e2-28d4-425b-0a66-08dcaa3ae636 X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?dnh9PCif2PF7G2NADAkHp02KWxIwDo1f2LICXQweFqe0ybgrLUfKCxTFOKYn?= =?us-ascii?Q?QxkVGV4AqYHkVLjOiNejAMfOsy1RvFB0rBkvD6rSAd2VLJVbo6nRff+rTXoV?= =?us-ascii?Q?MyCb524m1i7JD9QDt2JF8rvmSrLTzv1A/We+UndF0RZTnu0KMi8QK+wm3yr4?= =?us-ascii?Q?oKml1F9xb4QMOoEGzEryxYQ1od1iGxENQPrlrCumE+gVSdsUX65+jm8Ofn6X?= =?us-ascii?Q?BxShajgl+1aMuEkxOpNGV+CAVn7MMu85PCu8VwYAQzIoJ758P7uaeC/I/F3z?= =?us-ascii?Q?m6/t4LIldMRHfbDEKO7E8SEaRN+tf2MIqEMo+F/xg37kaYmUVQmYwKb+Oe0S?= =?us-asc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hm17M6sXRhDkvjJbx?= =?us-ascii?Q?dKF/5hoUXdPKVtQnF5+XNCRAOnkoZ+p+fYlE+Bt0+aJm+JFy2QGCHs2pdLRd?= =?us-ascii?Q?j3Q7neuo8v+WS4ZQ+i96SKs2QhP/K04cpp3951Z4S8BudA=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?u/WheVZP1rsn5ycsHtmaEOUtOEXpc8gaxn544c5xgIDJ8OpE9R5pLl8JQVMz?= =?us-ascii?Q?4LcqXQ81CM+fLxDZQxr1H4j/ejsMkb1A6bocWnRgkXZ38ZKoOAuO8y1FU5kf?= =?us-ascii?Q?WU2D6r6e0vniD92Kjf9+/E3yAN/LE/Cbh3rOHMBn6Ar+j7Vn+TVz9Hdhuufe?= =?us-ascii?Q?n9MIAlvilHgsSSqdkozqGmPqVml27nMn/8d9LYxNiTh1QcRZyP+iAVQx2jjU?= =?us-ascii?Q?Gf4Z5Q6K8Oe+imBH8nW/pdSzF1QQg2kNowbC/Q5p7FquwBSd8XKXEmhRvUr9?= =?us-ascii?Q?6JUxW2ipd4znvcoUcCU0TCQRlsL0ZffdtKjh6/IEe29P9LYJJnpvWgA5s+fV?= =?us-ascii?Q?skCFOwdRK1YkoePog9W5bXCau6jL8NMVGKDs2zEm6YgHUFAsaasvEZ9aEjd+?= =?us-ascii?Q?Vo2UYF9h4wt250LtXsqIyNR6M6+W7biDK9cszIJcDdXUfOtr72dJ+JkesU/t?= =?us-ascii?Q?/QWIPd24kG7AhlFp8QaDZfZd7rt1fnwWnlPgJkASWFT5rkIEczbHSgMkYIqU?= =?us-ascii?Q?TzP54MCg6/wwL4A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?XlfPtfJlxUGZ+hrd9ApfmPpQB1JzDCWDOdVLceqknDFH/0CMHV9CjAB2cvtT?= =?us-ascii?Q?ugqkv8s3GSBsKj8PYgsaLeU6aYv3h9Ra3NNX4fEDz6EiBnIrPZf71rOGt4tl?= =?us-ascii?Q?X6YgQdyycQoZAGbFrpi4N+LgwSoaZEnbs2D/A7TJR8qDTq1Hcbgb7Bx1IFrA?= =?us-ascii?Q?OQ=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 75c904e2-28d4-425b-0a66-08dcaa3ae636 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jul 2024 10:41:52.9112 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: CFBP+WxeeIRp0p9LNrWG1+wp8FkeKBXPIoK83aScoJyc9seqieIwbi4fkpWxT5cKxnC2hhIB+tnfOpRPzzSD6VG2pUAMSu30nKD0ZMJURhM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB6216 X-OriginatorOrg: intel.com 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 Mon, Jul 22, 2024 at 08:28:34AM +0000, Vladimir Medvedkin wrote: > This patch fixes possible memory leak inside the > ice_hash_parse_raw_pattern() due to the lack of a call to rte_free() > for previously allocated pkt_buf and msk_buf. > > Fixes: 1b9c68120a1c ("net/ice: enable protocol agnostic flow offloading in RSS") > Cc: stable@dpdk.org > > Reported-by: Michael Theodore Stolarchuk > Signed-off-by: Vladimir Medvedkin > --- > drivers/net/ice/ice_hash.c | 21 +++++++++++++-------- > 1 file changed, 13 insertions(+), 8 deletions(-) > > - if (ice_parser_run(ad->psr, pkt_buf, pkt_len, &rslt)) > - return -rte_errno; > + ret = ice_parser_run(ad->psr, pkt_buf, pkt_len, &rslt); > + if (ret) > + goto free_mem; > > - if (ice_parser_profile_init(&rslt, pkt_buf, msk_buf, > - pkt_len, ICE_BLK_RSS, true, &prof)) > - return -rte_errno; > + ret = ice_parser_profile_init(&rslt, pkt_buf, msk_buf, > + pkt_len, ICE_BLK_RSS, true, &prof); > + goto free_mem; Are we not still missing an "if (ret != 0)" here? If so, I can just add on apply. /Bruce