/* find and lock the specified key type against removal */
struct key_type* key_type_lookup(const char *type)
/* find and lock the specified key type against removal */
struct key_type* key_type_lookup(const char *type)
{
	struct key_type *ktype;
	down_read(&key_types_sem);
	list_for_each_entry(ktype, &key_types_list, link) {
		if (strcmp(ktype->name, type) == 0)
			goto found_kernel_type;
	}
	up_read(&key_types_sem);
	ktype = ERR_PTR(-ENOKEY);
 found_kernel_type:
	return ktype;
}