lkml.org 
[lkml]   [2020]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2] hv_netvsc: Fix memory leak when removing rndis device
From
From: Mohammed Gamal <mgamal@redhat.com>
Date: Tue, 14 Jan 2020 15:09:50 +0200

> kmemleak detects the following memory leak when hot removing
> a network device:
>
> unreferenced object 0xffff888083f63600 (size 256):
...
>
> rndis_filter_device_add() allocates an instance of struct rndis_device
> which never gets deallocated as rndis_filter_device_remove() sets
> net_device->extension which points to the rndis_device struct to NULL,
> leaving the rndis_device dangling.
>
> Since net_device->extension is eventually freed in free_netvsc_device(),
> we refrain from setting it to NULL inside rndis_filter_device_remove()
>
> Signed-off-by: Mohammed Gamal <mgamal@redhat.com>

Applied, thanks.

\
 
 \ /
  Last update: 2020-01-15 22:39    [W:0.030 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site