Chao Yu
29ba108d9b
f2fs: fix memory leak of kobject in error path of fill_super
...
f2fs_sb_info::s_kobj should be released in error path of fill_super,
otherwise it will lead to memory leak.
This bug was found by kmemleak:
dmesg:
kmemleak: 2 new suspected memory leaks (see /sys/kernel/debug/kmemleak)
cat /sys/kernel/debug/kmemleak
unreferenced object 0xffff8800838dc358 (size 8):
comm "mount", pid 4154, jiffies 4297482839 (age 1911.412s)
hex dump (first 8 bytes):
7a 72 61 6d 31 00 ff ff zram1...
backtrace:
[<ffffffff817a3668>] kmemleak_alloc+0x28/0x50
[<ffffffff811dc99f>] __kmalloc_track_caller+0xef/0x1c0
[<ffffffff8119d1c5>] kstrdup+0x45/0x80
[<ffffffff8119d228>] kstrdup_const+0x28/0x30
[<ffffffff813d2333>] kvasprintf_const+0x63/0xa0
[<ffffffff813c59fc>] kobject_set_name_vargs+0x3c/0xa0
[<ffffffff813c5a85>] kobject_add_varg+0x25/0x60
[<ffffffff813c5b13>] kobject_init_and_add+0x53/0x70
[<ffffffffa07ced19>] f2fs_fill_super+0x9d9/0xc40 [f2fs]
[<ffffffff811ff0b2>] mount_bdev+0x192/0x1d0
[<ffffffffa07cd3e5>] f2fs_mount+0x15/0x20 [f2fs]
[<ffffffff811fec93>] mount_fs+0x43/0x170
[<ffffffff81220256>] vfs_kern_mount+0x76/0x160
[<ffffffff812211c8>] do_mount+0x258/0xdc0
[<ffffffff81221dab>] SyS_mount+0x7b/0xc0
[<ffffffff817aecd7>] entry_SYSCALL_64_fastpath+0x12/0x6f
...
Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2015-12-04 11:52:34 -08:00
..
2015-11-13 18:02:30 -08:00
2015-06-30 19:44:57 -07:00
2015-09-10 13:29:01 -07:00
2015-05-11 10:50:17 -04:00
2015-06-23 18:02:01 -04:00
2015-07-04 19:36:06 -07:00
2015-04-26 17:22:07 -07:00
2015-11-27 15:45:45 -08:00
2015-11-16 20:38:43 -05:00
2015-11-13 09:24:40 -08:00
2015-11-13 16:40:36 -08:00
2015-09-10 13:29:01 -07:00
2015-11-20 16:17:32 -08:00
2015-11-11 02:04:44 -05:00
2015-06-30 19:44:58 -07:00
2015-12-01 15:45:05 -05:00
2015-11-07 13:05:44 -08:00
2015-05-06 10:57:37 -07:00
2015-06-25 17:00:42 -07:00
2015-11-09 15:11:24 -08:00
2015-11-16 09:43:54 -08:00
2015-11-16 09:43:54 -08:00
2015-12-04 11:52:34 -08:00
2015-11-20 16:17:32 -08:00
2015-08-07 13:59:24 +02:00
2015-11-11 02:11:02 -05:00
2015-10-22 14:57:36 -04:00
2015-11-13 18:02:30 -08:00
2015-09-10 13:29:01 -07:00
2015-11-13 20:34:32 -05:00
2015-09-04 16:54:41 -07:00
2015-11-09 15:11:24 -08:00
2015-11-20 16:17:32 -08:00
2015-04-15 15:06:57 -04:00
2015-11-07 14:32:45 -08:00
2015-11-13 20:34:32 -05:00
2015-11-09 15:11:24 -08:00
2015-08-18 15:49:15 -07:00
2015-11-11 20:11:28 -08:00
2015-11-06 17:50:42 -08:00
2015-07-04 19:36:06 -07:00
2015-11-20 16:17:32 -08:00
2015-11-25 15:32:13 -05:00
2015-08-13 10:22:06 -04:00
2015-11-10 09:29:45 -05:00
2015-11-11 09:45:24 -08:00
2015-11-05 19:34:48 -08:00
2015-11-06 17:50:42 -08:00
2015-11-20 16:17:32 -08:00
2015-05-28 18:25:19 -07:00
2015-10-31 14:49:19 -07:00
2015-11-07 14:32:45 -08:00
2015-11-02 13:41:52 -08:00
2015-06-23 18:02:00 -04:00
2015-09-05 20:34:28 -07:00
2015-10-16 11:42:28 -07:00
2015-11-13 18:02:30 -08:00
2015-04-11 22:29:40 -04:00
2015-11-13 20:34:33 -05:00
2015-11-13 21:53:18 -08:00
2015-11-23 21:11:08 -05:00
2015-11-04 22:13:45 -05:00
2015-11-13 18:02:30 -08:00
2015-08-20 14:58:35 +02:00
2015-09-09 10:43:12 -07:00
2015-11-13 18:02:30 -08:00
2015-09-04 16:54:41 -07:00
2015-11-10 12:07:22 -08:00
2015-11-11 09:45:24 -08:00
2015-04-26 17:22:07 -07:00
2015-11-19 13:47:10 -08:00
2015-11-11 02:19:33 -05:00
2015-08-05 13:49:35 -07:00
2015-10-23 23:26:43 +02:00
2015-11-06 17:50:42 -08:00
2015-11-16 23:54:45 -08:00
2015-08-21 02:34:37 -04:00
2015-11-30 10:15:42 -07:00
2015-08-17 18:39:46 -04:00
2015-07-10 10:39:25 -05:00
2015-06-02 10:29:07 -07:00
2015-08-07 04:39:40 +03:00
2015-11-05 23:05:32 -08:00
2015-04-09 11:39:55 -05:00
2015-11-11 02:18:27 -05:00
2015-11-11 02:18:27 -05:00
2015-08-17 23:38:10 -04:00
2015-11-16 23:54:45 -08:00
2015-04-14 16:49:05 -07:00
2015-08-12 15:28:45 -05:00
2015-10-22 14:57:42 -04:00
2015-10-15 10:33:21 -04:00
2015-06-30 19:44:56 -07:00
2015-11-06 17:50:42 -08:00
2015-11-07 14:32:45 -08:00
2015-09-01 16:13:25 -07:00
2015-09-11 15:21:34 -07:00
2015-07-10 10:39:25 -05:00
2015-11-11 02:18:26 -05:00
2015-07-22 20:33:27 -05:00
2015-11-13 20:34:32 -05:00
2015-06-30 19:44:56 -07:00
2015-04-11 22:29:46 -04:00
2015-05-19 08:32:00 +02:00
2015-11-06 17:50:42 -08:00
2015-08-07 04:39:40 +03:00
2015-11-23 21:15:30 -05:00
2015-11-09 15:11:24 -08:00
2015-08-21 02:31:20 -04:00
2015-11-06 17:50:42 -08:00
2015-09-22 15:09:53 -07:00
2015-11-13 20:34:33 -05:00