NFS: Error out when register_shrinker fail in register_nfs_fs
Commit 1d3d4437ea
"vmscan: per-node deferred work" have made
register_shrinker can return an intergater error.
If register_shrinker() fail, the later unregister_shrinker() will
cause a NULL pointer access.
v2, same as v1.
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
This commit is contained in:
parent
efcbc04e16
commit
5ef8d792fa
1 changed files with 5 additions and 2 deletions
|
@ -381,9 +381,12 @@ int __init register_nfs_fs(void)
|
|||
ret = nfs_register_sysctl();
|
||||
if (ret < 0)
|
||||
goto error_2;
|
||||
register_shrinker(&acl_shrinker);
|
||||
ret = register_shrinker(&acl_shrinker);
|
||||
if (ret < 0)
|
||||
goto error_3;
|
||||
return 0;
|
||||
|
||||
error_3:
|
||||
nfs_unregister_sysctl();
|
||||
error_2:
|
||||
unregister_nfs4_fs();
|
||||
error_1:
|
||||
|
|
Loading…
Reference in a new issue