diff options
author | Tony Krowiak | 2023-03-20 11:04:47 -0400 |
---|---|---|
committer | Greg Kroah-Hartman | 2023-04-06 12:10:46 +0200 |
commit | 6a40fda14b4be3e38f03cc42ffd4efbc64fb3e67 (patch) | |
tree | 47c0a312daa0a93254fc34e8eb5aa6a54df3de38 /net/netrom | |
parent | c11dbc7705b3739974ac31a13f4ab81e61a5fb07 (diff) |
s390/vfio-ap: fix memory leak in vfio_ap device driver
[ Upstream commit 8f8cf767589f2131ae5d40f3758429095c701c84 ]
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: 1fde573413b5 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/netrom')
0 files changed, 0 insertions, 0 deletions