Skip to content

Commit

Permalink
afs: Fix an IS_ERR() vs NULL check
Browse files Browse the repository at this point in the history
[ Upstream commit a33d626 ]

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 <dan.carpenter@oracle.com>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: linux-afs@lists.infradead.org
Link: https://lore.kernel.org/r/YLjMRKX40pTrJvgf@mwanda/
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Dan Carpenter authored and gregkh committed Jun 23, 2021
1 parent 5efb0b3 commit 090b1bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/afs/main.c
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 090b1bb

Please sign in to comment.