/* Returns pointer to "struct tomoyo_path_info" on success, NULL otherwise.  */
static struct tomoyo_path_info* tomoyo_get_path(struct path *path)
/* Returns pointer to "struct tomoyo_path_info" on success, NULL otherwise.  */
static struct tomoyo_path_info* tomoyo_get_path(struct path *path)
{
	int error;
	struct tomoyo_path_info_with_data *buf = tomoyo_alloc(sizeof(*buf));
	if (!buf)
		return NULL;
	error = tomoyo_realpath_from_path2(path, buf->body,
					   sizeof(buf->body) - 2);
	if (!error) {
		buf->head.name = buf->body;
		tomoyo_fill_path_info(&buf->head);
		return &buf->head;
	}
	tomoyo_free(buf);
	return NULL;
}