From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3C88EA0350 for ; Mon, 29 Jun 2020 11:56:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F287B2C01; Mon, 29 Jun 2020 11:56:28 +0200 (CEST) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by dpdk.org (Postfix) with ESMTP id 59ABAA3 for ; Mon, 29 Jun 2020 11:56:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593424587; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=sx6VLvyi0fhyNHgC7WivEpQ8721QQcNY5sJYWeLTYgc=; b=DpiqysIP5pUKEZHby8tXj7h0pYLpYat68yLTNPDEW1Oe53/EC1GvVH3FOWd5Sdg5Q7U59D 2gHlCHsbl81/3eNhKpJ74kmCoVF/70gXB/RCjK0aRO7Onkd2if/9uga7N1zmexxkLQxm13 qPgqaNZ8jOG8Gjb+5lCf7USQJZQT9Eg= Received: from mail-vk1-f198.google.com (mail-vk1-f198.google.com [209.85.221.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-53-EsWwirr3OneC0GHqaILZXA-1; Mon, 29 Jun 2020 05:56:26 -0400 X-MC-Unique: EsWwirr3OneC0GHqaILZXA-1 Received: by mail-vk1-f198.google.com with SMTP id n129so2602862vkn.0 for ; Mon, 29 Jun 2020 02:56:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=sx6VLvyi0fhyNHgC7WivEpQ8721QQcNY5sJYWeLTYgc=; b=le7k/gL8pv38V0STLSUzJKKs6qXZkvTBm2qKPGjDfBgTnHA6u6rRztGJbpMrvFV2P5 +J+Nyz096rIaPssrJPf+BCLpep/mfP6NYRIxbYP1GFqLClwnuM9PlZ9IcHAwvYGs+fxm hH0Eftcdv5F0iQXMgsCiryhOpp9uDEAWSeTjNWjedWbGsWWWFhSKltf/3vSn9Th6j3hC LttQFsaBlWrObyUWUfGq8WM61zZNvMAMZFbrbjcR/nTFZDM7FSHrAf/wdRlPvWWonalQ bk6vpmuZFGR6qrhE2lmLerW7bmF4Giwp1BkQXi2sPM9nlp8+KLkjywjTxP3SUvaEx3/Y qRyQ== X-Gm-Message-State: AOAM533tgtiZ9mZ8b+IlzULP3GgNpHkUu1U0lnVOdqnrZEJ9ZnZxA5/i 57BlVgvq/aN0XDWCCH1YSKS1TCmnAYWFCfTBhkzUPAdRumFJEueGagr3p40hQPJQLqNIq/HyQpM 4qQPOhMOOMfogcqnU7i2Sopc= X-Received: by 2002:a67:2fc6:: with SMTP id v189mr10202390vsv.198.1593424585732; Mon, 29 Jun 2020 02:56:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbDdC65Dxy+ds/6ZRstdvSo10NkOWN5Iw4SRdGuCMkoGPU7pF0TaVSHE7lzQLOzQGtlMa7O2f0dCGcuapD44M= X-Received: by 2002:a67:2fc6:: with SMTP id v189mr10202385vsv.198.1593424585456; Mon, 29 Jun 2020 02:56:25 -0700 (PDT) MIME-Version: 1.0 References: <20200614140035.247D44C87@dpdk.org> In-Reply-To: <20200614140035.247D44C87@dpdk.org> From: David Marchand Date: Mon, 29 Jun 2020 11:56:14 +0200 Message-ID: To: Yunjian Wang , "Burakov, Anatoly" Cc: dev , dpdk stable Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] vfio: fix mem leak when unmapping resource X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 Sender: "stable" On Sun, Jun 14, 2020 at 4:01 PM Yunjian Wang wrote: > > The 'vfio_res' is not freed when unmapping resource by primary process. > This leads to memory leak. > > Fixes: ab53203e194b ("vfio: enable unmapping resource for secondary") > Cc: stable@dpdk.org > > Signed-off-by: Yunjian Wang > --- > drivers/bus/pci/linux/pci_vfio.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c > index 64cd84a68..bf4c3c1fa 100644 > --- a/drivers/bus/pci/linux/pci_vfio.c > +++ b/drivers/bus/pci/linux/pci_vfio.c > @@ -966,6 +966,7 @@ pci_vfio_unmap_resource_primary(struct rte_pci_device *dev) > } > > TAILQ_REMOVE(vfio_res_list, vfio_res, next); > + rte_free(vfio_res); > > return 0; > } > -- > 2.18.1 > Since this element is removed from the shared list, I guess no secondary is using it anymore. Reviewed-by: David Marchand -- David Marchand