summaryrefslogtreecommitdiff
path: root/security/integrity/ima/ima_api.c
diff options
context:
space:
mode:
authorDmitry Kasatkin <d.kasatkin@samsung.com>2013-11-13 22:23:20 +0200
committerMimi Zohar <zohar@linux.vnet.ibm.com>2014-03-07 12:15:46 -0500
commit61997c4383c28fe93fb053295562ff6482ef5c07 (patch)
tree4db0680a4246655d9176a46bc0b60d520da13a17 /security/integrity/ima/ima_api.c
parent2bb930abcf39d8be243ddb4583cf013ea2a750d6 (diff)
ima: return d_name.name if d_path fails
This is a small refactoring so ima_d_path() returns dentry name if path reconstruction fails. It simplifies callers actions and removes code duplication. Signed-off-by: Dmitry Kasatkin <d.kasatkin@samsung.com> Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Diffstat (limited to 'security/integrity/ima/ima_api.c')
-rw-r--r--security/integrity/ima/ima_api.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/security/integrity/ima/ima_api.c b/security/integrity/ima/ima_api.c
index c6b4a732e89b..ba9e4d792dd5 100644
--- a/security/integrity/ima/ima_api.c
+++ b/security/integrity/ima/ima_api.c
@@ -332,5 +332,5 @@ const char *ima_d_path(struct path *path, char **pathbuf)
pathname = NULL;
}
}
- return pathname;
+ return pathname ?: (const char *)path->dentry->d_name.name;
}