X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=fs%2Fnamei.c;h=f3c5b278895a0d3e0f23fe6fd474e2728a1c6cb6;hb=8227b29722fdbac72357aae155d171a5c777670c;hp=5b961eb71cbf9781988b50559ff10842f49e483a;hpb=fd0cca754f3f6756bfdafe500e4f49b1b9e9723f;p=~andy%2Flinux diff --git a/fs/namei.c b/fs/namei.c index 5b961eb71cb..f3c5b278895 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -1761,6 +1761,10 @@ do_last: goto exit; } filp = nameidata_to_filp(&nd, open_flag); + if (IS_ERR(filp)) + ima_counts_put(&nd.path, + acc_mode & (MAY_READ | MAY_WRITE | + MAY_EXEC)); mnt_drop_write(nd.path.mnt); if (nd.root.mnt) path_put(&nd.root); @@ -1817,6 +1821,9 @@ ok: goto exit; } filp = nameidata_to_filp(&nd, open_flag); + if (IS_ERR(filp)) + ima_counts_put(&nd.path, + acc_mode & (MAY_READ | MAY_WRITE | MAY_EXEC)); /* * It is now safe to drop the mnt write * because the filp has had a write taken