WSL2-Linux-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
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
scsi scsi: zfcp: Trace when request remove fails after qdio send fails 2023-02-21 22:00:51 -05:00
virtio
Makefile