Skip to contentSkip to conversation

afs: Fix an IS_ERR() vs NULL check

PATCH New Dan Carpenter 1 participant 1 message Jun 3, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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")
---
 fs/afs/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/afs/main.c +2 -2
index b2975256dadb..179004b15566 100644
@@ -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