Re: [PATCH 3/3] fs/ext4: create ext4_kset dynamically

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/27, Andreas Dilger wrote:
> On Nov 27, 2017, at 4:18 PM, Riccardo Schirone <sirmy15@xxxxxxxxx> 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



[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux