]> Git Repo - linux.git/commitdiff
afs: Fix an IS_ERR() vs NULL check
authorDan Carpenter <[email protected]>
Tue, 15 Jun 2021 07:39:52 +0000 (08:39 +0100)
committerLinus Torvalds <[email protected]>
Tue, 15 Jun 2021 14:42:26 +0000 (07:42 -0700)
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 <[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]>
fs/afs/main.c

index b2975256dadbdf3abe4a1f1c784f83ec6d7ba8c2..179004b15566d326d507403500486d7f4377234e 100644 (file)
@@ -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;
        }
 
This page took 0.056885 seconds and 4 git commands to generate.