aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-02-19 07:57:43 -0500
committerMarcel Holtmann <marcel@holtmann.org>2014-02-19 11:04:23 -0500
commit0a14ab416d7754be0bb0d4306c996f72f52fa5bf (patch)
treebc952493bde217c1166658928779763a58960e05
parentd66c295031aec712e179d21de66602d631390f34 (diff)
Bluetooth: Avoid using GFP_ATOMIC where not necessary
The various pieces of data cached in the hci_dev structure do not need to be allocated using GFP_ATOMIC since they are never added from interrupt context. This patch updates these allocations to use GFP_KERNEL instead. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r--net/bluetooth/hci_core.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index e8f61b3fe87c..7e679e085506 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -2721,7 +2721,7 @@ int hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, int new_key,
2721 key = old_key; 2721 key = old_key;
2722 } else { 2722 } else {
2723 old_key_type = conn ? conn->key_type : 0xff; 2723 old_key_type = conn ? conn->key_type : 0xff;
2724 key = kzalloc(sizeof(*key), GFP_ATOMIC); 2724 key = kzalloc(sizeof(*key), GFP_KERNEL);
2725 if (!key) 2725 if (!key)
2726 return -ENOMEM; 2726 return -ENOMEM;
2727 list_add(&key->list, &hdev->link_keys); 2727 list_add(&key->list, &hdev->link_keys);
@@ -2773,7 +2773,7 @@ int hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 addr_type, u8 type,
2773 if (old_key) 2773 if (old_key)
2774 key = old_key; 2774 key = old_key;
2775 else { 2775 else {
2776 key = kzalloc(sizeof(*key), GFP_ATOMIC); 2776 key = kzalloc(sizeof(*key), GFP_KERNEL);
2777 if (!key) 2777 if (!key)
2778 return -ENOMEM; 2778 return -ENOMEM;
2779 list_add(&key->list, &hdev->long_term_keys); 2779 list_add(&key->list, &hdev->long_term_keys);
@@ -2938,7 +2938,7 @@ int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr,
2938 2938
2939 data = hci_find_remote_oob_data(hdev, bdaddr); 2939 data = hci_find_remote_oob_data(hdev, bdaddr);
2940 if (!data) { 2940 if (!data) {
2941 data = kmalloc(sizeof(*data), GFP_ATOMIC); 2941 data = kmalloc(sizeof(*data), GFP_KERNEL);
2942 if (!data) 2942 if (!data)
2943 return -ENOMEM; 2943 return -ENOMEM;
2944 2944
@@ -2965,7 +2965,7 @@ int hci_add_remote_oob_ext_data(struct hci_dev *hdev, bdaddr_t *bdaddr,
2965 2965
2966 data = hci_find_remote_oob_data(hdev, bdaddr); 2966 data = hci_find_remote_oob_data(hdev, bdaddr);
2967 if (!data) { 2967 if (!data) {
2968 data = kmalloc(sizeof(*data), GFP_ATOMIC); 2968 data = kmalloc(sizeof(*data), GFP_KERNEL);
2969 if (!data) 2969 if (!data)
2970 return -ENOMEM; 2970 return -ENOMEM;
2971 2971