Lines Matching refs:ptr
46 bool tomoyo_memory_ok(void *ptr) in tomoyo_memory_ok() argument
48 if (ptr) { in tomoyo_memory_ok()
49 const size_t s = ksize(ptr); in tomoyo_memory_ok()
74 void *ptr = kzalloc(size, GFP_NOFS); in tomoyo_commit_ok() local
75 if (tomoyo_memory_ok(ptr)) { in tomoyo_commit_ok()
76 memmove(ptr, data, size); in tomoyo_commit_ok()
78 return ptr; in tomoyo_commit_ok()
80 kfree(ptr); in tomoyo_commit_ok()
149 struct tomoyo_name *ptr; in tomoyo_get_name() local
161 list_for_each_entry(ptr, head, head.list) { in tomoyo_get_name()
162 if (hash != ptr->entry.hash || strcmp(name, ptr->entry.name) || in tomoyo_get_name()
163 atomic_read(&ptr->head.users) == TOMOYO_GC_IN_PROGRESS) in tomoyo_get_name()
165 atomic_inc(&ptr->head.users); in tomoyo_get_name()
168 ptr = kzalloc(sizeof(*ptr) + len, GFP_NOFS); in tomoyo_get_name()
169 if (tomoyo_memory_ok(ptr)) { in tomoyo_get_name()
170 ptr->entry.name = ((char *) ptr) + sizeof(*ptr); in tomoyo_get_name()
171 memmove((char *) ptr->entry.name, name, len); in tomoyo_get_name()
172 atomic_set(&ptr->head.users, 1); in tomoyo_get_name()
173 tomoyo_fill_path_info(&ptr->entry); in tomoyo_get_name()
174 list_add_tail(&ptr->head.list, head); in tomoyo_get_name()
176 kfree(ptr); in tomoyo_get_name()
177 ptr = NULL; in tomoyo_get_name()
181 return ptr ? &ptr->entry : NULL; in tomoyo_get_name()