[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZBm0EvrdTNlnG4sP@osiris>
Date: Tue, 21 Mar 2023 14:41:38 +0100
From: Heiko Carstens <hca@...ux.ibm.com>
To: Tony Krowiak <akrowiak@...ux.ibm.com>
Cc: linux-s390@...r.kernel.org, linux-kernel@...r.kernel.org,
borntraeger@...ibm.com, pasic@...ux.vnet.ibm.com,
jjherne@...ux.ibm.com, frankja@...ux.ibm.com, david@...hat.com,
imbrenda@...ux.ibm.com
Subject: Re: [PATCH v2] s390/vfio_ap: fix memory leak in vfio_ap device driver
On Mon, Mar 20, 2023 at 11:04:47AM -0400, Tony Krowiak wrote:
> 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@...ux.ibm.com>
> Reviewed-by: Harald Freudenberger <freude@...ux.ibm.com>
> ---
> drivers/s390/crypto/vfio_ap_drv.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
Applied.
Powered by blists - more mailing lists