[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20200115.133841.500823231264389395.davem@davemloft.net>
Date: Wed, 15 Jan 2020 13:38:41 -0800 (PST)
From: David Miller <davem@...emloft.net>
To: mgamal@...hat.com
Cc: linux-hyperv@...r.kernel.org, sthemmin@...rosoft.com,
haiyangz@...rosoft.com, netdev@...r.kernel.org, kys@...rosoft.com,
sashal@...nel.org, vkuznets@...hat.com, cavery@...hat.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] hv_netvsc: Fix memory leak when removing rndis
device
From: Mohammed Gamal <mgamal@...hat.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@...hat.com>
Applied, thanks.
Powered by blists - more mailing lists