block/rnbd-clt: Fix missing a memory free when unloading the module
authorGioh Kim <gi-oh.kim@cloud.ionos.com>
Mon, 19 Apr 2021 07:37:15 +0000 (09:37 +0200)
committerJens Axboe <axboe@kernel.dk>
Tue, 20 Apr 2021 14:59:04 +0000 (08:59 -0600)
commit12b06533104e802df73c1fbe159437c19933d6c0
treea5bd08018c1adf081f1d0642326cf659238609f9
parentce9d2b4f7bbeec818766f1e809816ba37b9aa4fa
block/rnbd-clt: Fix missing a memory free when unloading the module

When unloading the rnbd-clt module, it does not free a memory
including the filename of the symbolic link to /sys/block/rnbdX.

It is found by kmemleak as below.

unreferenced object 0xffff9f1a83d3c740 (size 16):
  comm "bash", pid 736, jiffies 4295179665 (age 9841.310s)
  hex dump (first 16 bytes):
    21 64 65 76 21 6e 75 6c 6c 62 30 40 62 6c 61 00  !dev!nullb0@bla.
  backtrace:
    [<0000000039f0c55e>] 0xffffffffc0456c24
    [<000000001aab9513>] kernfs_fop_write+0xcf/0x1c0
    [<00000000db5aa4b3>] vfs_write+0xdb/0x1d0
    [<000000007a2e2207>] ksys_write+0x65/0xe0
    [<00000000055e280a>] do_syscall_64+0x50/0x1b0
    [<00000000c2b51831>] entry_SYSCALL_64_after_hwframe+0x49/0xbe

Signed-off-by: Gioh Kim <gi-oh.kim@ionos.com>
Signed-off-by: Jack Wang <jinpu.wang@ionos.com>
Link: https://lore.kernel.org/r/20210419073722.15351-13-gi-oh.kim@ionos.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/rnbd/rnbd-clt-sysfs.c