Take ima_file_free() to proper place.
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 7 Feb 2010 08:07:29 +0000 (03:07 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 7 Feb 2010 08:07:29 +0000 (03:07 -0500)
Hooks: Just Say No.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/file_table.c
security/security.c

index 69652c5bd5f0ad83b983324d4dc2d31b7a1cd689..b98404b5438385dc803498ba5e0c710a7244ed60 100644 (file)
@@ -253,6 +253,7 @@ void __fput(struct file *file)
        if (file->f_op && file->f_op->release)
                file->f_op->release(inode, file);
        security_file_free(file);
+       ima_file_free(file);
        if (unlikely(S_ISCHR(inode->i_mode) && inode->i_cdev != NULL))
                cdev_put(inode->i_cdev);
        fops_put(file->f_op);
index 24e060be9fa54b64994b6e5fe65674b42a90928c..122b748d0f4c5cbb11b04fd11a954429136586c2 100644 (file)
@@ -666,8 +666,6 @@ int security_file_alloc(struct file *file)
 void security_file_free(struct file *file)
 {
        security_ops->file_free_security(file);
-       if (file->f_dentry)
-               ima_file_free(file);
 }
 
 int security_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)