[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171128105147.GC83442@rschirone-mbp.local>
Date: Tue, 28 Nov 2017 11:51:47 +0100
From: "Riccardo S." <sirmy15@...il.com>
To: Andreas Dilger <adilger@...ger.ca>
Cc: Theodore Ts'o <tytso@....edu>,
linux-ext4 <linux-ext4@...r.kernel.org>
Subject: Re: [PATCH 3/3] fs/ext4: create ext4_kset dynamically
On 11/27, Andreas Dilger wrote:
> On Nov 27, 2017, at 4:18 PM, Riccardo Schirone <sirmy15@...il.com> wrote:
> >
> > - ext4_feat->kset = &ext4_kset;
> > + ext4_feat->kset = ext4_kset;
> > ret = kobject_init_and_add(ext4_feat, &ext4_feat_ktype,
> > NULL, "features");
> > if (ret)
> > @@ -455,14 +464,14 @@ int __init ext4_init_sysfs(void)
> > feat_err:
> > kobject_put(ext4_feat);
> > kset_err:
> > - kset_unregister(&ext4_kset);
> > + kset_unregister(ext4_kset);
>
>
> It would be prudent in this case to set "ext4_kset = NULL" here
> so that it isn't cleaned up again somewhere else. Otherwise,
> it seems possible that ext4_kset could be cleaned up twice.
>
> Otherwise, the whole premise of this patch seems flawed.
Right, I'll do it in V2.
>
> > return ret;
> > }
> >
> > void ext4_exit_sysfs(void)
> > {
> > kobject_put(ext4_feat);
> > - kset_unregister(&ext4_kset);
> > + kset_unregister(ext4_kset);
>
> Same here.
>
> > remove_proc_entry(proc_dirname, NULL);
> > ext4_proc_root = NULL;
> > }
> > --
> > 2.14.3
> >
>
>
> Cheers, Andreas
>
>
Thanks,
Riccardo
Powered by blists - more mailing lists