On Tue, Nov 28, 2017 at 11:51:47AM +0100, Riccardo S. wrote: > 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. I don't think we ever got a V2, so I've applied this patch with Andreas's suggestions. - Ted