Linux-HyperV Archive on lore.kernel.org
 help / color / 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)
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 index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-14 13:09 Mohammed Gamal
2020-01-14 13:20 ` Haiyang Zhang
2020-01-15 21:38 ` David Miller [this message]

Reply instructions:

You may reply publically 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

Linux-HyperV Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-hyperv/0 linux-hyperv/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-hyperv linux-hyperv/ https://lore.kernel.org/linux-hyperv \
		linux-hyperv@vger.kernel.org
	public-inbox-index linux-hyperv

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-hyperv


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git