linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: Wang Hai <wanghai38@huawei.com>
Cc: Vishal L Verma <vishal.l.verma@intel.com>,
	Dave Jiang <dave.jiang@intel.com>,
	linux-nvdimm <linux-nvdimm@lists.01.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] dax: fix memory leak when rmmod dax.ko
Date: Tue, 15 Dec 2020 22:06:30 -0800	[thread overview]
Message-ID: <CAPcyv4gAmPLQnNwenDoaGQ7Ah9-eEkuL2xSoqi_zyg1waZYg9Q@mail.gmail.com> (raw)
In-Reply-To: <20201201135929.66530-1-wanghai38@huawei.com>

On Tue, Dec 1, 2020 at 5:54 AM Wang Hai <wanghai38@huawei.com> wrote:
>
> When I repeatedly modprobe and rmmod dax.ko, kmemleak report a
> memory leak as follows:
>
> unreferenced object 0xffff9a5588c05088 (size 8):
>   comm "modprobe", pid 261, jiffies 4294693644 (age 42.063s)
> ...
>   backtrace:
>     [<00000000e007ced0>] kstrdup+0x35/0x70
>     [<000000002ae73897>] kstrdup_const+0x3d/0x50
>     [<000000002b00c9c3>] kvasprintf_const+0xbc/0xf0
>     [<000000008023282f>] kobject_set_name_vargs+0x3b/0xd0
>     [<00000000d2cbaa4e>] kobject_set_name+0x62/0x90
>     [<00000000202e7a22>] bus_register+0x7f/0x2b0
>     [<000000000b77792c>] 0xffffffffc02840f7
>     [<000000002d5be5ac>] 0xffffffffc02840b4
>     [<00000000dcafb7cd>] do_one_initcall+0x58/0x240
>     [<00000000049fe480>] do_init_module+0x56/0x1e2
>     [<0000000022671491>] load_module+0x2517/0x2840
>     [<000000001a2201cb>] __do_sys_finit_module+0x9c/0xe0
>     [<000000003eb304e7>] do_syscall_64+0x33/0x40
>     [<0000000051c5fd06>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
>
> When rmmod dax is executed, dax_bus_exit() is missing. This patch
> can fix this bug.
>
> Fixes: 9567da0b408a ("device-dax: Introduce bus + driver model")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wang Hai <wanghai38@huawei.com>

Looks good, applied.

...with some fixups to the changelog to add Cc: stable and change the
title to "device-dax/core: Fix..."

      reply	other threads:[~2020-12-16  6:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-01 13:59 [PATCH] dax: fix memory leak when rmmod dax.ko Wang Hai
2020-12-16  6:06 ` Dan Williams [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=CAPcyv4gAmPLQnNwenDoaGQ7Ah9-eEkuL2xSoqi_zyg1waZYg9Q@mail.gmail.com \
    --to=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvdimm@lists.01.org \
    --cc=vishal.l.verma@intel.com \
    --cc=wanghai38@huawei.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).