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 8AF07A0350; Mon, 29 Jun 2020 11:56:30 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2A7FA1B75C; Mon, 29 Jun 2020 11:56:30 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id D30F2A3 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=1593424588; 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=goYJ9K7y8zWbn7kyfo44BN8HLmVHpL3djn7a2Ah8IhMW+ymEltGNcElY2V9AyjyD3iMsRv GuObRy5JSIFOWeK8V5mqUapkdj3bVGSdyyRL4Y3JYeG71XKbhSsHI6cN6owDteqMyZyaZ2 qyY8bBatDa9hYjzcjsMDm3DHXaKEfhM= Received: from mail-vs1-f69.google.com (mail-vs1-f69.google.com [209.85.217.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-474-LLfEoQ1zPfiAsAw7VmrbWA-1; Mon, 29 Jun 2020 05:56:26 -0400 X-MC-Unique: LLfEoQ1zPfiAsAw7VmrbWA-1 Received: by mail-vs1-f69.google.com with SMTP id u123so4932370vsb.2 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=lbCDSbYxqo4Vag9bw4ROv7BF8wjZVesZGFGn6M1T7qUiDnvgX7GVNcUROrNNpFDBMK 1j5pixu9z6vOurJODWkhiZQ2aSsWiERDT66Gb3CsY0nljSSAHkitHZ+l+NUco0Hf4K8U +UbZmCYzDm3u9Cj1iCDCXoUTcDfXgGfTCEvBBS9+Y/gh49k2dxq585trbfHk7cOBpJmF Aq7OruuRuxbSBmtDQwv+n0xRsjvPolvAHG/eUrH+L/WPgVKH+TGD+yGo3h2/YnZMGC7P Ej4ueW/vt0YJpR+aAcQ7F6ZsZn4K7bDknRoC3p/n8zdov3bZ4pihD1bO5w8uHepvGrJy dAoA== X-Gm-Message-State: AOAM530+NbQST3lWSaf1qWPKJasaY0pPj0PSdIe6H78LNEkT+X0wAXq4 i1riz11Wd6A6moWGBhpHooXGfKG7cr9BAkNv5wyrz3lbkBn1NrSJ5L0Qc7AY8flF9zZG+7Z42sA G5ni402T5Xda+YER84ns= X-Received: by 2002:a67:2fc6:: with SMTP id v189mr10202389vsv.198.1593424585730; 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 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH] vfio: fix mem leak when unmapping resource X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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