netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: mgamal@redhat.com
Cc: linux-hyperv@vger.kernel.org, sthemmin@microsoft.com,
	haiyangz@microsoft.com, netdev@vger.kernel.org,
	kys@microsoft.com, sashal@kernel.org, vkuznets@redhat.com,
	cavery@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] hv_netvsc: Fix memory leak when removing rndis device
Date: Wed, 15 Jan 2020 13:38:41 -0800 (PST)	[thread overview]
Message-ID: <20200115.133841.500823231264389395.davem@davemloft.net> (raw)
In-Reply-To: <20200114130950.6962-1-mgamal@redhat.com>

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.

      parent reply	other threads:[~2020-01-15 21:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-14 13:09 [PATCH v2] hv_netvsc: Fix memory leak when removing rndis device Mohammed Gamal
2020-01-14 13:20 ` Haiyang Zhang
2020-01-15 21:38 ` David Miller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200115.133841.500823231264389395.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=cavery@redhat.com \
    --cc=haiyangz@microsoft.com \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgamal@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=sashal@kernel.org \
    --cc=sthemmin@microsoft.com \
    --cc=vkuznets@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).