Skip to content

Commit

Permalink
afs: Fix an IS_ERR() vs NULL check
Browse files Browse the repository at this point in the history
The proc_symlink() function returns NULL on error, it doesn't return
error pointers.

Fixes: 5b86d4f ("afs: Implement network namespacing")
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: David Howells <[email protected]>
cc: [email protected]
Link: https://lore.kernel.org/r/YLjMRKX40pTrJvgf@mwanda/
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Dan Carpenter authored and torvalds committed Jun 15, 2021
1 parent 009c9aa commit a33d626
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/afs/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit a33d626

Please sign in to comment.