diff options
author | Dmitry Kasatkin <d.kasatkin@samsung.com> | 2014-09-03 03:19:57 -0400 |
---|---|---|
committer | Mimi Zohar <zohar@linux.vnet.ibm.com> | 2014-09-09 10:28:48 -0400 |
commit | 3a8a2eadc4946ce3af39b3447c32532324538f75 (patch) | |
tree | 59000b738dee69aba5b19ac1531dbb88e4ddcba1 /security/integrity | |
parent | f68c05f4d2d4e19c40f4ac1e769cc0a2f9f544a0 (diff) |
ima: remove unnecessary extra variable
'function' variable value can be changed instead of
allocating extra '_func' variable.
Signed-off-by: Dmitry Kasatkin <d.kasatkin@samsung.com>
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Diffstat (limited to 'security/integrity')
-rw-r--r-- | security/integrity/ima/ima_main.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c index f7b85bf0eaf3..aaf5552e808d 100644 --- a/security/integrity/ima/ima_main.c +++ b/security/integrity/ima/ima_main.c | |||
@@ -164,7 +164,7 @@ static int process_measurement(struct file *file, const char *filename, | |||
164 | struct ima_template_desc *template_desc; | 164 | struct ima_template_desc *template_desc; |
165 | char *pathbuf = NULL; | 165 | char *pathbuf = NULL; |
166 | const char *pathname = NULL; | 166 | const char *pathname = NULL; |
167 | int rc = -ENOMEM, action, must_appraise, _func; | 167 | int rc = -ENOMEM, action, must_appraise; |
168 | struct evm_ima_xattr_data *xattr_value = NULL, **xattr_ptr = NULL; | 168 | struct evm_ima_xattr_data *xattr_value = NULL, **xattr_ptr = NULL; |
169 | int xattr_len = 0; | 169 | int xattr_len = 0; |
170 | 170 | ||
@@ -182,7 +182,8 @@ static int process_measurement(struct file *file, const char *filename, | |||
182 | must_appraise = action & IMA_APPRAISE; | 182 | must_appraise = action & IMA_APPRAISE; |
183 | 183 | ||
184 | /* Is the appraise rule hook specific? */ | 184 | /* Is the appraise rule hook specific? */ |
185 | _func = (action & IMA_FILE_APPRAISE) ? FILE_CHECK : function; | 185 | if (action & IMA_FILE_APPRAISE) |
186 | function = FILE_CHECK; | ||
186 | 187 | ||
187 | mutex_lock(&inode->i_mutex); | 188 | mutex_lock(&inode->i_mutex); |
188 | 189 | ||
@@ -201,7 +202,7 @@ static int process_measurement(struct file *file, const char *filename, | |||
201 | /* Nothing to do, just return existing appraised status */ | 202 | /* Nothing to do, just return existing appraised status */ |
202 | if (!action) { | 203 | if (!action) { |
203 | if (must_appraise) | 204 | if (must_appraise) |
204 | rc = ima_get_cache_status(iint, _func); | 205 | rc = ima_get_cache_status(iint, function); |
205 | goto out_digsig; | 206 | goto out_digsig; |
206 | } | 207 | } |
207 | 208 | ||
@@ -223,7 +224,7 @@ static int process_measurement(struct file *file, const char *filename, | |||
223 | ima_store_measurement(iint, file, pathname, | 224 | ima_store_measurement(iint, file, pathname, |
224 | xattr_value, xattr_len); | 225 | xattr_value, xattr_len); |
225 | if (action & IMA_APPRAISE_SUBMASK) | 226 | if (action & IMA_APPRAISE_SUBMASK) |
226 | rc = ima_appraise_measurement(_func, iint, file, pathname, | 227 | rc = ima_appraise_measurement(function, iint, file, pathname, |
227 | xattr_value, xattr_len, opened); | 228 | xattr_value, xattr_len, opened); |
228 | if (action & IMA_AUDIT) | 229 | if (action & IMA_AUDIT) |
229 | ima_audit_measurement(iint, pathname); | 230 | ima_audit_measurement(iint, pathname); |