diff mbox

drm/vc4: Fix leak of the file_priv that stored the perfmon.

Message ID 20180409205813.7077-1-eric@anholt.net (mailing list archive)
State New, archived
Headers show

Commit Message

Eric Anholt April 9, 2018, 8:58 p.m. UTC
Signed-off-by: Eric Anholt <eric@anholt.net>
Fixes: 65101d8c9108 ("drm/vc4: Expose performance counters to userspace")
---
 drivers/gpu/drm/vc4/vc4_drv.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Boris Brezillon April 12, 2018, 9:14 a.m. UTC | #1
On Mon,  9 Apr 2018 13:58:13 -0700
Eric Anholt <eric@anholt.net> wrote:

> Signed-off-by: Eric Anholt <eric@anholt.net>
> Fixes: 65101d8c9108 ("drm/vc4: Expose performance counters to userspace")

Reviewed-by: Boris Brezillon <boris.brezillon@bootlin.com>

> ---
>  drivers/gpu/drm/vc4/vc4_drv.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c
> index 94b99c90425a..7c95ed5c5cac 100644
> --- a/drivers/gpu/drm/vc4/vc4_drv.c
> +++ b/drivers/gpu/drm/vc4/vc4_drv.c
> @@ -130,6 +130,7 @@ static void vc4_close(struct drm_device *dev, struct drm_file *file)
>  	struct vc4_file *vc4file = file->driver_priv;
>  
>  	vc4_perfmon_close_file(vc4file);
> +	kfree(vc4file);
>  }
>  
>  static const struct vm_operations_struct vc4_vm_ops = {
Eric Anholt April 12, 2018, 11:09 p.m. UTC | #2
Boris Brezillon <boris.brezillon@bootlin.com> writes:

> On Mon,  9 Apr 2018 13:58:13 -0700
> Eric Anholt <eric@anholt.net> wrote:
>
>> Signed-off-by: Eric Anholt <eric@anholt.net>
>> Fixes: 65101d8c9108 ("drm/vc4: Expose performance counters to userspace")
>
> Reviewed-by: Boris Brezillon <boris.brezillon@bootlin.com>

Applied to drm-misc-next-fixes.  Thanks!
diff mbox

Patch

diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c
index 94b99c90425a..7c95ed5c5cac 100644
--- a/drivers/gpu/drm/vc4/vc4_drv.c
+++ b/drivers/gpu/drm/vc4/vc4_drv.c
@@ -130,6 +130,7 @@  static void vc4_close(struct drm_device *dev, struct drm_file *file)
 	struct vc4_file *vc4file = file->driver_priv;
 
 	vc4_perfmon_close_file(vc4file);
+	kfree(vc4file);
 }
 
 static const struct vm_operations_struct vc4_vm_ops = {