Liu Shixin
203a55f04f
ubifs: Fix memory leak in ubifs_sysfs_init()
...
When insmod ubifs.ko, a kmemleak reported as below:
unreferenced object 0xffff88817fb1a780 (size 8):
comm "insmod", pid 25265, jiffies 4295239702 (age 100.130s)
hex dump (first 8 bytes):
75 62 69 66 73 00 ff ff ubifs...
backtrace:
[<ffffffff81b3fc4c>] slab_post_alloc_hook+0x9c/0x3c0
[<ffffffff81b44bf3>] __kmalloc_track_caller+0x183/0x410
[<ffffffff8198d3da>] kstrdup+0x3a/0x80
[<ffffffff8198d486>] kstrdup_const+0x66/0x80
[<ffffffff83989325>] kvasprintf_const+0x155/0x190
[<ffffffff83bf55bb>] kobject_set_name_vargs+0x5b/0x150
[<ffffffff83bf576b>] kobject_set_name+0xbb/0xf0
[<ffffffff8100204c>] do_one_initcall+0x14c/0x5a0
[<ffffffff8157e380>] do_init_module+0x1f0/0x660
[<ffffffff815857be>] load_module+0x6d7e/0x7590
[<ffffffff8158644f>] __do_sys_finit_module+0x19f/0x230
[<ffffffff815866b3>] __x64_sys_finit_module+0x73/0xb0
[<ffffffff88c98e85>] do_syscall_64+0x35/0x80
[<ffffffff88e00087>] entry_SYSCALL_64_after_hwframe+0x63/0xcd
When kset_register() failed, we should call kset_put to cleanup it.
Fixes: 2e3cbf425804 ("ubifs: Export filesystem error counters")
Signed-off-by: Liu Shixin <liushixin2@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
2023-02-02 21:13:35 +01:00
..
2021-02-12 21:53:22 +01:00
2022-05-27 16:21:20 +02:00
2020-12-13 22:12:32 +01:00
2019-07-08 19:43:53 +02:00
2022-09-21 11:32:38 +02:00
2022-11-18 02:15:15 +01:00
2020-12-13 22:12:38 +01:00
2022-10-14 18:23:23 -07:00
2022-08-02 12:34:04 -04:00
2019-06-05 17:37:07 +02:00
2021-12-23 22:30:38 +01:00
2022-01-10 22:58:27 +01:00
2022-01-10 22:18:42 +01:00
2022-10-16 15:27:07 -07:00
2019-12-31 10:33:51 -06:00
2020-01-22 14:49:56 -08:00
2019-07-08 19:43:51 +02:00
2020-08-23 17:36:59 -05:00
2022-11-18 02:15:15 +01:00
2020-12-13 21:57:10 +01:00
2021-12-23 20:23:42 +01:00
2021-06-22 09:21:39 +02:00
2018-08-15 00:25:21 +02:00
2020-08-02 22:59:03 +02:00
2020-12-13 22:12:32 +01:00
2020-12-13 22:12:32 +01:00
2021-12-23 20:23:40 +01:00
2021-04-15 22:00:26 +02:00
2020-12-13 22:12:32 +01:00
2019-06-05 17:37:07 +02:00
2022-07-03 18:08:40 -07:00
2023-02-02 21:13:35 +01:00
2022-11-18 02:15:15 +01:00
2020-12-13 22:12:32 +01:00
2020-12-13 22:12:32 +01:00
2019-07-08 19:43:53 +02:00
2023-02-02 21:13:34 +01:00
2022-09-21 11:32:58 +02:00