Bluetooth: btusb: Use GFP_KERNEL in btusb_send_frame()
authorJohan Hedberg <johan.hedberg@intel.com>
Sun, 14 Sep 2014 05:49:34 +0000 (08:49 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Sun, 14 Sep 2014 06:56:46 +0000 (08:56 +0200)
All hdev->send() calls are these days done through a work queue. For the
btusb driver this means the btusb_send_frame() function. Because of this
we can safely use GFP_KERNEL for all memory allocations in this code
path.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
drivers/bluetooth/btusb.c

index a79d657c0845b65f520427b9b7b2b12a76b0a544..d696e68f326a2834c5d23e2585244531bf653c8e 100644 (file)
@@ -769,11 +769,11 @@ static int btusb_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
 
        switch (bt_cb(skb)->pkt_type) {
        case HCI_COMMAND_PKT:
-               urb = usb_alloc_urb(0, GFP_ATOMIC);
+               urb = usb_alloc_urb(0, GFP_KERNEL);
                if (!urb)
                        return -ENOMEM;
 
-               dr = kmalloc(sizeof(*dr), GFP_ATOMIC);
+               dr = kmalloc(sizeof(*dr), GFP_KERNEL);
                if (!dr) {
                        usb_free_urb(urb);
                        return -ENOMEM;
@@ -797,7 +797,7 @@ static int btusb_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
                if (!data->bulk_tx_ep)
                        return -ENODEV;
 
-               urb = usb_alloc_urb(0, GFP_ATOMIC);
+               urb = usb_alloc_urb(0, GFP_KERNEL);
                if (!urb)
                        return -ENOMEM;
 
@@ -814,7 +814,7 @@ static int btusb_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
                if (!data->isoc_tx_ep || hci_conn_num(hdev, SCO_LINK) < 1)
                        return -ENODEV;
 
-               urb = usb_alloc_urb(BTUSB_MAX_ISOC_FRAMES, GFP_ATOMIC);
+               urb = usb_alloc_urb(BTUSB_MAX_ISOC_FRAMES, GFP_KERNEL);
                if (!urb)
                        return -ENOMEM;
 
@@ -848,7 +848,7 @@ static int btusb_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
 skip_waking:
        usb_anchor_urb(urb, &data->tx_anchor);
 
-       err = usb_submit_urb(urb, GFP_ATOMIC);
+       err = usb_submit_urb(urb, GFP_KERNEL);
        if (err < 0) {
                if (err != -EPERM && err != -ENODEV)
                        BT_ERR("%s urb %p submission failed (%d)",