Commit a33d6266 authored by Dan Carpenter's avatar Dan Carpenter Committed by Linus Torvalds

afs: Fix an IS_ERR() vs NULL check

The proc_symlink() function returns NULL on error, it doesn't return
error pointers.

Fixes: 5b86d4ff ("afs: Implement network namespacing")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
cc: linux-afs@lists.infradead.org
Link: https://lore.kernel.org/r/YLjMRKX40pTrJvgf@mwanda/Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 009c9aa5
...@@ -203,8 +203,8 @@ static int __init afs_init(void) ...@@ -203,8 +203,8 @@ static int __init afs_init(void)
goto error_fs; goto error_fs;
afs_proc_symlink = proc_symlink("fs/afs", NULL, "../self/net/afs"); afs_proc_symlink = proc_symlink("fs/afs", NULL, "../self/net/afs");
if (IS_ERR(afs_proc_symlink)) { if (!afs_proc_symlink) {
ret = PTR_ERR(afs_proc_symlink); ret = -ENOMEM;
goto error_proc; goto error_proc;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment