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 BDE51A0540; Mon, 4 Jul 2022 15:25:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B328E410F6; Mon, 4 Jul 2022 15:25:56 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 60474410E5; Mon, 4 Jul 2022 15:25:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656941154; x=1688477154; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=VRjDYjgRWwAMgjrtjZwBfMAOljnD5Dx0K5zPwHJpK1U=; b=oHOnv6V51ooX+To2PMfM+BlrOJd2++z7i1lUbMNpitMR2UqU0n5bT8EN UBFqDNT7U5+JFZUjBCjlFiTQoOaoGqM1Gs750kmX96IIpiyh+XKcOc8i7 FcmhggJR6+TGwvl2O+AZt6kD2Bp4P42rRhhHVT/rClwJ/DDd5DdJDAssR nEx4b0yzBWVrPeIesmkNeyeaJIC+5NYu4iIf/x9+icdl/6SENLazZUR5a 4S/nuY+l90P0j+RA3LQ5Qi8uPOW/yt8h0RumAvjfBiP9imOKfU38lq93s 9B+ruuYskG+BrqB8kjMz+w3/fc9Jyep9Zf4rgVypbwvdlSNMjMzLzASzc g==; X-IronPort-AV: E=McAfee;i="6400,9594,10397"; a="266153997" X-IronPort-AV: E=Sophos;i="5.92,243,1650956400"; d="scan'208";a="266153997" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jul 2022 06:25:53 -0700 X-IronPort-AV: E=Sophos;i="5.92,243,1650956400"; d="scan'208";a="619292768" Received: from bricha3-mobl.ger.corp.intel.com ([10.252.1.180]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 04 Jul 2022 06:25:52 -0700 Date: Mon, 4 Jul 2022 14:25:49 +0100 From: Bruce Richardson To: Kevin Laatz Cc: dev@dpdk.org, stable@dpdk.org Subject: Re: [PATCH v2 2/3] dma/idxd: fix memory leak due to free on incorrect pointer Message-ID: References: <20220408141504.1319913-1-kevin.laatz@intel.com> <20220703122243.929642-1-kevin.laatz@intel.com> <20220703122243.929642-3-kevin.laatz@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 04, 2022 at 02:23:38PM +0100, Bruce Richardson wrote: > On Sun, Jul 03, 2022 at 01:22:42PM +0100, Kevin Laatz wrote: > > During PCI device close, any allocated memory needs to be free'd. > > Currently, one of the free's is being called on an incorrect idxd_dmadev > > struct member, namely 'batch_idx_ring', causing a memleak from the > > pointer that should have been free'd. > > I think you need to explain that the two rings are beside each other in > memory and we need to free using the pointer to the start of the block, > rather than the pointer to the middle of it. > > > This patch fixes this memleak by calling free on the correct pointer. > > > > Fixes: 9449330a8458 ("dma/idxd: create dmadev instances on PCI probe") > > Cc: stable@dpdk.org > > Cc: bruce.richardson@intel.com > > > > Signed-off-by: Kevin Laatz > > With more explanation in the commit log > Correction (obviously!) Acked-by: Bruce Richardson