aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/proc_sysctl.c
diff options
context:
space:
mode:
authorDanilo Krummrich <danilokrummrich@dk-develop.de>2018-04-10 19:31:41 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-04-11 13:28:33 -0400
commit835b94e05c92e6e8df48112770e624cee192a057 (patch)
tree919e263799d0a5c3d224bb578ad86353c7f58cb1 /fs/proc/proc_sysctl.c
parenta0b0d1c345d0317efe594df268feb5ccc99f651e (diff)
fs/proc/proc_sysctl.c: remove redundant link check in proc_sys_link_fill_cache()
proc_sys_link_fill_cache() does not need to check whether we're called for a link - it's already done by scan(). Link: http://lkml.kernel.org/r/20180228013506.4915-2-danilokrummrich@dk-develop.de Signed-off-by: Danilo Krummrich <danilokrummrich@dk-develop.de> Acked-by: Kees Cook <keescook@chromium.org> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Cc: Alexey Dobriyan <adobriyan@gmail.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: "Luis R . Rodriguez" <mcgrof@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc/proc_sysctl.c')
-rw-r--r--fs/proc/proc_sysctl.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c
index 7da10e595297..4654fc3c246f 100644
--- a/fs/proc/proc_sysctl.c
+++ b/fs/proc/proc_sysctl.c
@@ -712,12 +712,9 @@ static bool proc_sys_link_fill_cache(struct file *file,
712 if (IS_ERR(head)) 712 if (IS_ERR(head))
713 return false; 713 return false;
714 714
715 if (S_ISLNK(table->mode)) { 715 /* It is not an error if we can not follow the link ignore it */
716 /* It is not an error if we can not follow the link ignore it */ 716 if (sysctl_follow_link(&head, &table))
717 int err = sysctl_follow_link(&head, &table); 717 goto out;
718 if (err)
719 goto out;
720 }
721 718
722 ret = proc_sys_fill_cache(file, ctx, head, table); 719 ret = proc_sys_fill_cache(file, ctx, head, table);
723out: 720out: