[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210618133524.22386-1-jjherne@linux.ibm.com>
Date: Fri, 18 Jun 2021 09:35:24 -0400
From: "Jason J. Herne" <jjherne@...ux.ibm.com>
To: linux-s390@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, pasic@...ux.ibm.com,
akrowiak@...ux.ibm.com, jgg@...dia.com
Subject: [PATCH] s390/vfio-ap: Fix module unload memory leak of matrix_dev
vfio_ap_matrix_dev_release is shadowing the global matrix_dev with driver
data that never gets set. So when release is called we end up not freeing
matrix_dev. The fix is to remove the shadow variable and just free the
global.
Signed-off-by: Jason J. Herne <jjherne@...ux.ibm.com>
---
drivers/s390/crypto/vfio_ap_drv.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/s390/crypto/vfio_ap_drv.c b/drivers/s390/crypto/vfio_ap_drv.c
index 7dc72cb718b0..6d3eea838e18 100644
--- a/drivers/s390/crypto/vfio_ap_drv.c
+++ b/drivers/s390/crypto/vfio_ap_drv.c
@@ -82,8 +82,6 @@ static void vfio_ap_queue_dev_remove(struct ap_device *apdev)
static void vfio_ap_matrix_dev_release(struct device *dev)
{
- struct ap_matrix_dev *matrix_dev = dev_get_drvdata(dev);
-
kfree(matrix_dev);
}
--
2.21.1
Powered by blists - more mailing lists