diff options
Diffstat (limited to 'security/integrity/ima/ima_api.c')
-rw-r--r-- | security/integrity/ima/ima_api.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/security/integrity/ima/ima_api.c b/security/integrity/ima/ima_api.c index d9cd5ce14d2b..65c41a968cc1 100644 --- a/security/integrity/ima/ima_api.c +++ b/security/integrity/ima/ima_api.c | |||
@@ -330,10 +330,9 @@ const char *ima_d_path(struct path *path, char **pathbuf) | |||
330 | { | 330 | { |
331 | char *pathname = NULL; | 331 | char *pathname = NULL; |
332 | 332 | ||
333 | /* We will allow 11 spaces for ' (deleted)' to be appended */ | 333 | *pathbuf = kmalloc(PATH_MAX, GFP_KERNEL); |
334 | *pathbuf = kmalloc(PATH_MAX + 11, GFP_KERNEL); | ||
335 | if (*pathbuf) { | 334 | if (*pathbuf) { |
336 | pathname = d_path(path, *pathbuf, PATH_MAX + 11); | 335 | pathname = d_absolute_path(path, *pathbuf, PATH_MAX); |
337 | if (IS_ERR(pathname)) { | 336 | if (IS_ERR(pathname)) { |
338 | kfree(*pathbuf); | 337 | kfree(*pathbuf); |
339 | *pathbuf = NULL; | 338 | *pathbuf = NULL; |