acrn-kernel/drivers/s390
Tony Krowiak 8f8cf76758 s390/vfio-ap: fix memory leak in vfio_ap device driver
The device release callback function invoked to release the matrix device
uses the dev_get_drvdata(device *dev) function to retrieve the
pointer to the vfio_matrix_dev object in order to free its storage. The
problem is, this object is not stored as drvdata with the device; since the
kfree function will accept a NULL pointer, the memory for the
vfio_matrix_dev object is never freed.

Since the device being released is contained within the vfio_matrix_dev
object, the container_of macro will be used to retrieve its pointer.

Fixes: 1fde573413 ("s390: vfio-ap: base implementation of VFIO AP device driver")
Signed-off-by: Tony Krowiak <akrowiak@linux.ibm.com>
Reviewed-by: Harald Freudenberger <freude@linux.ibm.com>
Link: https://lore.kernel.org/r/20230320150447.34557-1-akrowiak@linux.ibm.com
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2023-03-27 17:23:08 +02:00
..
block s390/dasd: Fix potential memleak in dasd_eckd_init() 2023-02-09 17:05:43 -07:00
char TTY/Serial driver updates for 6.3-rc1 2023-02-24 12:17:14 -08:00
cio Driver core changes for 6.3-rc1 2023-02-24 12:58:55 -08:00
crypto s390/vfio-ap: fix memory leak in vfio_ap device driver 2023-03-27 17:23:08 +02:00
net s390/qeth: Convert sprintf/snprintf to scnprintf 2023-02-10 19:49:53 -08:00
scsi scsi: zfcp: Trace when request remove fails after qdio send fails 2023-02-21 22:00:51 -05:00
virtio s390/virtio: sort out physical vs virtual pointers usage 2023-02-08 09:59:46 +01:00
Makefile