Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 283229
b: refs/heads/master
c: 7845bc3
h: refs/heads/master
i:
  283227: 9128762
v: v3
  • Loading branch information
David Howells authored and James Morris committed Nov 16, 2011
1 parent 14a651f commit e1b962e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 24942c8e5cc8696064ee207ff29d4cf21f70dafc
refs/heads/master: 7845bc3964756240863ae453ffe4f7ee27ddc954
1 change: 1 addition & 0 deletions trunk/include/linux/key-type.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ struct key_type {

/* internal fields */
struct list_head link; /* link in types list */
struct lock_class_key lock_class; /* key->sem lock class */
};

extern struct key_type key_type_keyring;
Expand Down
3 changes: 3 additions & 0 deletions trunk/security/keys/key.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ struct key *key_alloc(struct key_type *type, const char *desc,

atomic_set(&key->usage, 1);
init_rwsem(&key->sem);
lockdep_set_class(&key->sem, &type->lock_class);
key->type = type;
key->user = user;
key->quotalen = quotalen;
Expand Down Expand Up @@ -946,6 +947,8 @@ int register_key_type(struct key_type *ktype)
struct key_type *p;
int ret;

memset(&ktype->lock_class, 0, sizeof(ktype->lock_class));

ret = -EEXIST;
down_write(&key_types_sem);

Expand Down

0 comments on commit e1b962e

Please sign in to comment.