sysctl: remove redundant ret assignment
authorluo penghao <luo.penghao@zte.com.cn>
Thu, 20 Jan 2022 02:08:09 +0000 (18:08 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 20 Jan 2022 06:52:52 +0000 (08:52 +0200)
Subsequent if judgments will assign new values to ret, so the statement
here should be deleted

The clang_analyzer complains as follows:

  fs/proc/proc_sysctl.c:
  Value stored to 'ret' is never read

Link: https://lkml.kernel.org/r/20211230063622.586360-1-luo.penghao@zte.com.cn
Signed-off-by: luo penghao <luo.penghao@zte.com.cn>
Reported-by: Zeal Robot <zealci@zte.com.cn>
Acked-by: Luis Chamberlain <mcgrof@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/proc/proc_sysctl.c

index 4f6168ec5079fc8f84f0bb4604878668101af2b4..389e1e42e7d9a0d650e31e80bc6173e3041f2f15 100644 (file)
@@ -1053,7 +1053,6 @@ static int sysctl_follow_link(struct ctl_table_header **phead,
        struct ctl_dir *dir;
        int ret;
 
-       ret = 0;
        spin_lock(&sysctl_lock);
        root = (*pentry)->data;
        set = lookup_header_set(root);