Lines Matching refs:ptr
47 bool tomoyo_memory_ok(void *ptr) in tomoyo_memory_ok() argument
49 if (ptr) { in tomoyo_memory_ok()
50 const size_t s = ksize(ptr); in tomoyo_memory_ok()
76 void *ptr = kzalloc(size, GFP_NOFS); in tomoyo_commit_ok() local
78 if (tomoyo_memory_ok(ptr)) { in tomoyo_commit_ok()
79 memmove(ptr, data, size); in tomoyo_commit_ok()
81 return ptr; in tomoyo_commit_ok()
83 kfree(ptr); in tomoyo_commit_ok()
154 struct tomoyo_name *ptr; in tomoyo_get_name() local
166 list_for_each_entry(ptr, head, head.list) { in tomoyo_get_name()
167 if (hash != ptr->entry.hash || strcmp(name, ptr->entry.name) || in tomoyo_get_name()
168 atomic_read(&ptr->head.users) == TOMOYO_GC_IN_PROGRESS) in tomoyo_get_name()
170 atomic_inc(&ptr->head.users); in tomoyo_get_name()
173 ptr = kzalloc(sizeof(*ptr) + len, GFP_NOFS); in tomoyo_get_name()
174 if (tomoyo_memory_ok(ptr)) { in tomoyo_get_name()
175 ptr->entry.name = ((char *) ptr) + sizeof(*ptr); in tomoyo_get_name()
176 memmove((char *) ptr->entry.name, name, len); in tomoyo_get_name()
177 atomic_set(&ptr->head.users, 1); in tomoyo_get_name()
178 tomoyo_fill_path_info(&ptr->entry); in tomoyo_get_name()
179 list_add_tail(&ptr->head.list, head); in tomoyo_get_name()
181 kfree(ptr); in tomoyo_get_name()
182 ptr = NULL; in tomoyo_get_name()
186 return ptr ? &ptr->entry : NULL; in tomoyo_get_name()