__getname() uses slab allocation which is faster than kmalloc.
Make use of it.
Signed-off-by: Dmitry Kasatkin <d.kasatkin@samsung.com>
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
 {
        char *pathname = NULL;
 
-       *pathbuf = kmalloc(PATH_MAX, GFP_KERNEL);
+       *pathbuf = __getname();
        if (*pathbuf) {
                pathname = d_absolute_path(path, *pathbuf, PATH_MAX);
                if (IS_ERR(pathname)) {
-                       kfree(*pathbuf);
+                       __putname(*pathbuf);
                        *pathbuf = NULL;
                        pathname = NULL;
                }
 
                rc = -EACCES;
        kfree(xattr_value);
 out_free:
-       kfree(pathbuf);
+       if (pathbuf)
+               __putname(pathbuf);
 out:
        mutex_unlock(&inode->i_mutex);
        if ((rc && must_appraise) && (ima_appraise & IMA_APPRAISE_ENFORCE))