summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2021-06-15 08:39:52 +0100
committerSasha Levin <sashal@kernel.org>2021-06-30 08:48:14 -0400
commit6b907d1a1ea9b95fc390c85e9c318ef99beaf968 (patch)
tree8a0f9bbc022d295ad19bb7cdd8d09d1ff58094c0
parent53f0b1fffafe99f40006fb1be99adf71a3472741 (diff)
downloadlinux-stable-6b907d1a1ea9b95fc390c85e9c318ef99beaf968.tar.gz
linux-stable-6b907d1a1ea9b95fc390c85e9c318ef99beaf968.tar.bz2
linux-stable-6b907d1a1ea9b95fc390c85e9c318ef99beaf968.zip
afs: Fix an IS_ERR() vs NULL check
[ Upstream commit a33d62662d275cee22888fa7760fe09d5b9cd1f9 ] 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 <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>
-rw-r--r--fs/afs/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/afs/main.c b/fs/afs/main.c
index 8ecb127be63f..2eecb2c0a3c0 100644
--- a/fs/afs/main.c
+++ b/fs/afs/main.c
@@ -200,8 +200,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;
}