From: Dan Carpenter Date: Tue, 15 Jun 2021 07:39:52 +0000 (+0100) Subject: afs: Fix an IS_ERR() vs NULL check X-Git-Tag: accepted/tizen/unified/20230118.172025~7067 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a33d62662d275cee22888fa7760fe09d5b9cd1f9;p=platform%2Fkernel%2Flinux-rpi.git 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") Signed-off-by: Dan Carpenter Signed-off-by: David Howells cc: linux-afs@lists.infradead.org Link: https://lore.kernel.org/r/YLjMRKX40pTrJvgf@mwanda/ Signed-off-by: Linus Torvalds --- diff --git a/fs/afs/main.c b/fs/afs/main.c index b297525..179004b 100644 --- a/fs/afs/main.c +++ b/fs/afs/main.c @@ -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; }