Skip to content

Commit

Permalink
Bluetooth: Use GFP_KERNEL in mgmt_pending_add
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andre Guedes authored and Gustavo Padovan committed Jun 19, 2012
1 parent 92c4c20 commit 12b9456
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/bluetooth/mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 12b9456

Please sign in to comment.