Bluetooth: Use GFP_KERNEL in mgmt_pending_add
authorAndre Guedes <aguedespe@gmail.com>
Thu, 7 Jun 2012 22:05:45 +0000 (19:05 -0300)
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>
Tue, 19 Jun 2012 03:53:37 +0000 (00:53 -0300)
We are allowed to sleep in mgmt_pending_add, so we should use
GFP_KERNEL for memory allocations instead of GFP_ATOMIC.

Signed-off-by: Andre Guedes <aguedespe@gmail.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
net/bluetooth/mgmt.c

index 86590c6532321c5b88053d241e5bb246e89c7dcb..41b5192bc04152836a09bde4692df347d505d668 100644 (file)
@@ -687,14 +687,14 @@ static struct pending_cmd *mgmt_pending_add(struct sock *sk, u16 opcode,
 {
        struct pending_cmd *cmd;
 
-       cmd = kmalloc(sizeof(*cmd), GFP_ATOMIC);
+       cmd = kmalloc(sizeof(*cmd), GFP_KERNEL);
        if (!cmd)
                return NULL;
 
        cmd->opcode = opcode;
        cmd->index = hdev->id;
 
-       cmd->param = kmalloc(len, GFP_ATOMIC);
+       cmd->param = kmalloc(len, GFP_KERNEL);
        if (!cmd->param) {
                kfree(cmd);
                return NULL;