diff options
Diffstat (limited to 'security/keys/request_key.c')
-rw-r--r-- | security/keys/request_key.c | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/security/keys/request_key.c b/security/keys/request_key.c index dc6ed32b7844..bb4337c7ae1b 100644 --- a/security/keys/request_key.c +++ b/security/keys/request_key.c | |||
@@ -21,24 +21,6 @@ | |||
21 | 21 | ||
22 | #define key_negative_timeout 60 /* default timeout on a negative key's existence */ | 22 | #define key_negative_timeout 60 /* default timeout on a negative key's existence */ |
23 | 23 | ||
24 | /* | ||
25 | * wait_on_bit() sleep function for uninterruptible waiting | ||
26 | */ | ||
27 | static int key_wait_bit(void *flags) | ||
28 | { | ||
29 | schedule(); | ||
30 | return 0; | ||
31 | } | ||
32 | |||
33 | /* | ||
34 | * wait_on_bit() sleep function for interruptible waiting | ||
35 | */ | ||
36 | static int key_wait_bit_intr(void *flags) | ||
37 | { | ||
38 | schedule(); | ||
39 | return signal_pending(current) ? -ERESTARTSYS : 0; | ||
40 | } | ||
41 | |||
42 | /** | 24 | /** |
43 | * complete_request_key - Complete the construction of a key. | 25 | * complete_request_key - Complete the construction of a key. |
44 | * @cons: The key construction record. | 26 | * @cons: The key construction record. |
@@ -603,10 +585,9 @@ int wait_for_key_construction(struct key *key, bool intr) | |||
603 | int ret; | 585 | int ret; |
604 | 586 | ||
605 | ret = wait_on_bit(&key->flags, KEY_FLAG_USER_CONSTRUCT, | 587 | ret = wait_on_bit(&key->flags, KEY_FLAG_USER_CONSTRUCT, |
606 | intr ? key_wait_bit_intr : key_wait_bit, | ||
607 | intr ? TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE); | 588 | intr ? TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE); |
608 | if (ret < 0) | 589 | if (ret) |
609 | return ret; | 590 | return -ERESTARTSYS; |
610 | if (test_bit(KEY_FLAG_NEGATIVE, &key->flags)) { | 591 | if (test_bit(KEY_FLAG_NEGATIVE, &key->flags)) { |
611 | smp_rmb(); | 592 | smp_rmb(); |
612 | return key->type_data.reject_error; | 593 | return key->type_data.reject_error; |