2012-01-30 12:22:09

by Andre Guedes

[permalink] [raw]
Subject: [PATCH 1/2] Bluetooth: Use GFP_KERNEL in hci_conn_add()

This function is called in process context only, so it should use
GFP_KERNEL to allocate memory.

Signed-off-by: Andre Guedes <[email protected]>
---
net/bluetooth/hci_conn.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index eae7a53..9ec7b8e 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -373,7 +373,7 @@ struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst)

BT_DBG("%s dst %s", hdev->name, batostr(dst));

- conn = kzalloc(sizeof(struct hci_conn), GFP_ATOMIC);
+ conn = kzalloc(sizeof(struct hci_conn), GFP_KERNEL);
if (!conn)
return NULL;

--
1.7.8.4



2012-01-30 19:08:36

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH 1/2] Bluetooth: Use GFP_KERNEL in hci_conn_add()

Hi Andre,

On Mon, Jan 30, 2012, Andre Guedes wrote:
> This function is called in process context only, so it should use
> GFP_KERNEL to allocate memory.
>
> Signed-off-by: Andre Guedes <[email protected]>
> ---
> net/bluetooth/hci_conn.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)

Both patches have been applied to my bluetooth-next tree. Thanks.

Johan

2012-01-30 18:24:07

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH 2/2] Bluetooth: Use GFP_KERNEL in hci_chan_create()

Hi Andre,

> This function is called in process context only, so it should use
> GFP_KERNEL to allocate memory.
>
> Signed-off-by: Andre Guedes <[email protected]>
> ---
> net/bluetooth/hci_conn.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)

Acked-by: Marcel Holtmann <[email protected]>

Regards

Marcel



2012-01-30 18:23:42

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH 1/2] Bluetooth: Use GFP_KERNEL in hci_conn_add()

Hi Andre,

> This function is called in process context only, so it should use
> GFP_KERNEL to allocate memory.
>
> Signed-off-by: Andre Guedes <[email protected]>
> ---
> net/bluetooth/hci_conn.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)

Acked-by: Marcel Holtmann <[email protected]>

Regards

Marcel



2012-01-30 16:36:55

by Ulisses Furquim

[permalink] [raw]
Subject: Re: [PATCH 2/2] Bluetooth: Use GFP_KERNEL in hci_chan_create()

Hi Andre,

On Mon, Jan 30, 2012 at 10:22 AM, Andre Guedes
<[email protected]> wrote:
> This function is called in process context only, so it should use
> GFP_KERNEL to allocate memory.
>
> Signed-off-by: Andre Guedes <[email protected]>
> ---
> ?net/bluetooth/hci_conn.c | ? ?2 +-
> ?1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
> index 9ec7b8e..7b38a0b 100644
> --- a/net/bluetooth/hci_conn.c
> +++ b/net/bluetooth/hci_conn.c
> @@ -945,7 +945,7 @@ struct hci_chan *hci_chan_create(struct hci_conn *conn)
>
> ? ? ? ?BT_DBG("%s conn %p", hdev->name, conn);
>
> - ? ? ? chan = kzalloc(sizeof(struct hci_chan), GFP_ATOMIC);
> + ? ? ? chan = kzalloc(sizeof(struct hci_chan), GFP_KERNEL);
> ? ? ? ?if (!chan)
> ? ? ? ? ? ? ? ?return NULL;
>

The two patches to use GFP_KERNEL seem ok to me and that's the path
Padovan and Marcel wanted to go, of course, now that we run in process
context.

Best regards,

--
Ulisses Furquim
ProFUSION embedded systems
http://profusion.mobi
Mobile: +55 19 9250 0942
Skype: ulissesffs

2012-01-30 12:22:10

by Andre Guedes

[permalink] [raw]
Subject: [PATCH 2/2] Bluetooth: Use GFP_KERNEL in hci_chan_create()

This function is called in process context only, so it should use
GFP_KERNEL to allocate memory.

Signed-off-by: Andre Guedes <[email protected]>
---
net/bluetooth/hci_conn.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 9ec7b8e..7b38a0b 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -945,7 +945,7 @@ struct hci_chan *hci_chan_create(struct hci_conn *conn)

BT_DBG("%s conn %p", hdev->name, conn);

- chan = kzalloc(sizeof(struct hci_chan), GFP_ATOMIC);
+ chan = kzalloc(sizeof(struct hci_chan), GFP_KERNEL);
if (!chan)
return NULL;

--
1.7.8.4