aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 5b961eb71cbf..f3c5b278895a 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1761,6 +1761,10 @@ do_last:
1761 goto exit; 1761 goto exit;
1762 } 1762 }
1763 filp = nameidata_to_filp(&nd, open_flag); 1763 filp = nameidata_to_filp(&nd, open_flag);
1764 if (IS_ERR(filp))
1765 ima_counts_put(&nd.path,
1766 acc_mode & (MAY_READ | MAY_WRITE |
1767 MAY_EXEC));
1764 mnt_drop_write(nd.path.mnt); 1768 mnt_drop_write(nd.path.mnt);
1765 if (nd.root.mnt) 1769 if (nd.root.mnt)
1766 path_put(&nd.root); 1770 path_put(&nd.root);
@@ -1817,6 +1821,9 @@ ok:
1817 goto exit; 1821 goto exit;
1818 } 1822 }
1819 filp = nameidata_to_filp(&nd, open_flag); 1823 filp = nameidata_to_filp(&nd, open_flag);
1824 if (IS_ERR(filp))
1825 ima_counts_put(&nd.path,
1826 acc_mode & (MAY_READ | MAY_WRITE | MAY_EXEC));
1820 /* 1827 /*
1821 * It is now safe to drop the mnt write 1828 * It is now safe to drop the mnt write
1822 * because the filp has had a write taken 1829 * because the filp has had a write taken