lockdep_assert_held(&shrinker_rwsem);
kfree_const(shrinker->name);
+ shrinker->name = NULL;
if (!shrinker->debugfs_entry)
return;
return -ENOMEM;
err = __prealloc_shrinker(shrinker);
- if (err)
+ if (err) {
kfree_const(shrinker->name);
+ shrinker->name = NULL;
+ }
return err;
}
{
#ifdef CONFIG_SHRINKER_DEBUG
kfree_const(shrinker->name);
+ shrinker->name = NULL;
#endif
if (shrinker->flags & SHRINKER_MEMCG_AWARE) {
down_write(&shrinker_rwsem);
return -ENOMEM;
err = __register_shrinker(shrinker);
- if (err)
+ if (err) {
kfree_const(shrinker->name);
+ shrinker->name = NULL;
+ }
return err;
}
#else