diff options
Diffstat (limited to 'security')
-rw-r--r-- | security/integrity/ima/ima_main.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c index cdae13c5ae05..1987424623c2 100644 --- a/security/integrity/ima/ima_main.c +++ b/security/integrity/ima/ima_main.c | |||
@@ -116,10 +116,6 @@ static int get_path_measurement(struct ima_iint_cache *iint, struct file *file, | |||
116 | { | 116 | { |
117 | int rc = 0; | 117 | int rc = 0; |
118 | 118 | ||
119 | if (IS_ERR(file)) { | ||
120 | pr_info("%s dentry_open failed\n", filename); | ||
121 | return rc; | ||
122 | } | ||
123 | iint->opencount++; | 119 | iint->opencount++; |
124 | iint->readcount++; | 120 | iint->readcount++; |
125 | 121 | ||
@@ -185,6 +181,12 @@ int ima_path_check(struct path *path, int mask) | |||
185 | struct vfsmount *mnt = mntget(path->mnt); | 181 | struct vfsmount *mnt = mntget(path->mnt); |
186 | 182 | ||
187 | file = dentry_open(dentry, mnt, O_RDONLY, current_cred()); | 183 | file = dentry_open(dentry, mnt, O_RDONLY, current_cred()); |
184 | if (IS_ERR(file)) { | ||
185 | pr_info("%s dentry_open failed\n", dentry->d_name.name); | ||
186 | rc = PTR_ERR(file); | ||
187 | file = NULL; | ||
188 | goto out; | ||
189 | } | ||
188 | rc = get_path_measurement(iint, file, dentry->d_name.name); | 190 | rc = get_path_measurement(iint, file, dentry->d_name.name); |
189 | } | 191 | } |
190 | out: | 192 | out: |