[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v1] xen/pvcalls: free active map buffer on pvcalls_front_free_map


  • To: "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>
  • From: Oleksii Moisieiev <Oleksii_Moisieiev@xxxxxxxx>
  • Date: Tue, 20 Dec 2022 14:50:13 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=r2ylN4NGfD1l/hT+56W7bcB6Q60E4babfEvcJ1KWBGE=; b=Xf9TGwEIpeBiOTJ8qfBCeIQFnnxrshYh0Q3Pv8IOAGPfZRPA3DsnGgtwtU2f6Gs1vTtHN1/uvNN5xgVcyGj4P6FTaauUznuFIH26TKHkEW+p2Dyu8Fwa0+QYHBiDnq5Qnt7ajBKEKn6poCc43UTwz+JttX0USUMNPyPfymkYLgi6xrQO49C1I3wpxfYtzXO9biit8lPQtzkOZ6ua+GPehsEYz3a4PEK9Li4iLvbwxsgYcczmGafkCVWnvlz4BKeT8M6K1dqW8ZlvW7+b9h2p+YcvzlWzsQjGtoH+ZFkKwe6+d7zsYX8s8po3U6GnKv/vJfW9VZUkA1+aQiNpJ+9MZA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l1rFNfqMHNClCKocS0cWyJHfNU4NxA5eMdDZpl0wtw/YhN7KHyQuFl2vaUXsUdPE3Pax1vTiZmykdMNuDEu6YL+pH7/krsbj8yYD5Qbt6sSLUYy8gAsLCEVsopormSHZwe3tclpwDH+amVlFbJcNqYnQjNjXWKPY2rVWGzzbigyaT9ZBvm+SNPCwKpZmzDmuc8/rADxYbwF3GzRTgW2UqX9D7rpagX0isjjYqyDO5OGBQ6s6tLs0gGdAo6s9xySDDmaQJPRq2W9rO8Pp07XfvtWzio9rbAI0+PqrIAw70UGBJFSqq9iYunJMriNnr3a5AMh3irvNMoZNaHwUxuKDHg==
  • Cc: Oleksii Moisieiev <Oleksii_Moisieiev@xxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Oleksandr Tyshchenko <Oleksandr_Tyshchenko@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 20 Dec 2022 14:50:34 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHZFIJdWCkKZGBL2Uu+Qwu1QSrhlA==
  • Thread-topic: [PATCH v1] xen/pvcalls: free active map buffer on pvcalls_front_free_map

Data buffer for active map is allocated in alloc_active_ring and freed
in free_active_ring function, which is used only for the error
cleanup. pvcalls_front_release is calling pvcalls_front_free_map which
ends foreign access for this buffer, but doesn't free allocated pages.
Call free_active_ring to clean all allocated resources.

Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@xxxxxxxx>
---
 drivers/xen/pvcalls-front.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/xen/pvcalls-front.c b/drivers/xen/pvcalls-front.c
index 1826e8e67125..9b569278788a 100644
--- a/drivers/xen/pvcalls-front.c
+++ b/drivers/xen/pvcalls-front.c
@@ -225,6 +225,8 @@ static irqreturn_t pvcalls_front_event_handler(int irq, 
void *dev_id)
        return IRQ_HANDLED;
 }
 
+static void free_active_ring(struct sock_mapping *map);
+
 static void pvcalls_front_free_map(struct pvcalls_bedata *bedata,
                                   struct sock_mapping *map)
 {
@@ -240,7 +242,7 @@ static void pvcalls_front_free_map(struct pvcalls_bedata 
*bedata,
        for (i = 0; i < (1 << PVCALLS_RING_ORDER); i++)
                gnttab_end_foreign_access(map->active.ring->ref[i], NULL);
        gnttab_end_foreign_access(map->active.ref, NULL);
-       free_page((unsigned long)map->active.ring);
+       free_active_ring(map);
 
        kfree(map);
 }
-- 
2.25.1



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.