afs: Fix an IS_ERR() vs NULL check
Subsystems (2)
PATCH 1/1 afs: Fix an IS_ERR() vs NULL check
The proc_symlink() function returns NULL on error, it doesn't return error pointers.
Fixes 5b86d4ff5dce ("afs: Implement network namespacing")
Signed-off-by Dan Carpenter <[email protected]>
--- fs/afs/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/afs/main.c +2 -2
@@ -203,8 +203,8 @@ static int __init afs_init(void) goto error_fs; afs_proc_symlink =proc_symlink ("fs/afs" ,NULL ,"../self/net/afs" ); -if (IS_ERR (afs_proc_symlink)) { - ret =PTR_ERR (afs_proc_symlink); +if (!afs_proc_symlink) { + ret = -ENOMEM ; goto error_proc; }
Signature · 1 line
2.30.2