diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/namei.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/namei.c b/fs/namei.c index 87f97ba90ad1..30c61c298b4c 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -644,8 +644,6 @@ static __always_inline int __do_follow_link(struct path *path, struct nameidata | |||
644 | if (dentry->d_inode->i_op->put_link) | 644 | if (dentry->d_inode->i_op->put_link) |
645 | dentry->d_inode->i_op->put_link(dentry, nd, cookie); | 645 | dentry->d_inode->i_op->put_link(dentry, nd, cookie); |
646 | } | 646 | } |
647 | path_put(path); | ||
648 | |||
649 | return error; | 647 | return error; |
650 | } | 648 | } |
651 | 649 | ||
@@ -672,6 +670,7 @@ static inline int do_follow_link(struct path *path, struct nameidata *nd) | |||
672 | current->total_link_count++; | 670 | current->total_link_count++; |
673 | nd->depth++; | 671 | nd->depth++; |
674 | err = __do_follow_link(path, nd); | 672 | err = __do_follow_link(path, nd); |
673 | path_put(path); | ||
675 | current->link_count--; | 674 | current->link_count--; |
676 | nd->depth--; | 675 | nd->depth--; |
677 | return err; | 676 | return err; |
@@ -1864,6 +1863,7 @@ do_link: | |||
1864 | if (error) | 1863 | if (error) |
1865 | goto exit_dput; | 1864 | goto exit_dput; |
1866 | error = __do_follow_link(&path, &nd); | 1865 | error = __do_follow_link(&path, &nd); |
1866 | path_put(&path); | ||
1867 | if (error) { | 1867 | if (error) { |
1868 | /* Does someone understand code flow here? Or it is only | 1868 | /* Does someone understand code flow here? Or it is only |
1869 | * me so stupid? Anathema to whoever designed this non-sense | 1869 | * me so stupid? Anathema to whoever designed this non-sense |