fs/proc/proc_sysctl.c: remove redundant link check in proc_sys_link_fill_cache()
[linux-2.6-block.git] / fs / proc / proc_sysctl.c
index c41ab261397df2875951db47ea38b7cbe2a5bae1..4654fc3c246fab0d4a79672e68438c970c4a49ec 100644 (file)
@@ -707,14 +707,14 @@ static bool proc_sys_link_fill_cache(struct file *file,
                                    struct ctl_table *table)
 {
        bool ret = true;
+
        head = sysctl_head_grab(head);
+       if (IS_ERR(head))
+               return false;
 
-       if (S_ISLNK(table->mode)) {
-               /* It is not an error if we can not follow the link ignore it */
-               int err = sysctl_follow_link(&head, &table);
-               if (err)
-                       goto out;
-       }
+       /* It is not an error if we can not follow the link ignore it */
+       if (sysctl_follow_link(&head, &table))
+               goto out;
 
        ret = proc_sys_fill_cache(file, ctx, head, table);
 out: