[1/3] ext4: null out kobject* during sysfs cleanup

Message ID 220173615bb10731afbb948b7ef6a5841a575c28.1520292208.git.tgnottingham@gmail.com
State Accepted
Headers show
Series
  • ext4: minor sysfs code cleanup
Related show

Commit Message

Tyson Nottingham March 6, 2018, 12:04 a.m.
Make cleanup of ext4_feat kobject consistent with similar objects.

Signed-off-by: Tyson Nottingham <tgnottingham@gmail.com>
---
 fs/ext4/sysfs.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Theodore Ts'o March 30, 2018, 4:05 a.m. | #1
On Mon, Mar 05, 2018 at 04:04:32PM -0800, Tyson Nottingham wrote:
> Make cleanup of ext4_feat kobject consistent with similar objects.
> 
> Signed-off-by: Tyson Nottingham <tgnottingham@gmail.com>

Applied, thanks.

					- Ted

Patch

diff --git a/fs/ext4/sysfs.c b/fs/ext4/sysfs.c
index 1205261..aa8165e 100644
--- a/fs/ext4/sysfs.c
+++ b/fs/ext4/sysfs.c
@@ -464,6 +464,7 @@  int __init ext4_init_sysfs(void)
 
 feat_err:
 	kobject_put(ext4_feat);
+	ext4_feat = NULL;
 kset_err:
 	kset_unregister(ext4_kset);
 	ext4_kset = NULL;
@@ -473,6 +474,7 @@  int __init ext4_init_sysfs(void)
 void ext4_exit_sysfs(void)
 {
 	kobject_put(ext4_feat);
+	ext4_feat = NULL;
 	kset_unregister(ext4_kset);
 	ext4_kset = NULL;
 	remove_proc_entry(proc_dirname, NULL);