2012-01-07 14:19:37

by David Herrmann

[permalink] [raw]
Subject: [PATCH] Bluetooth: hci-uart-ll: Use GFP_ATOMIC in open()

The uart_proto open() callback is not called in atomic context so we can safely
sleep here. The caller hci_uart_set_proto() in hci_ldisc.c is an ioctl() handler
and therefore can sleep.

Signed-off-by: David Herrmann <[email protected]>
---
drivers/bluetooth/hci_ll.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/bluetooth/hci_ll.c b/drivers/bluetooth/hci_ll.c
index 7e4b435..b874c0e 100644
--- a/drivers/bluetooth/hci_ll.c
+++ b/drivers/bluetooth/hci_ll.c
@@ -125,7 +125,7 @@ static int ll_open(struct hci_uart *hu)

BT_DBG("hu %p", hu);

- ll = kzalloc(sizeof(*ll), GFP_ATOMIC);
+ ll = kzalloc(sizeof(*ll), GFP_KERNEL);
if (!ll)
return -ENOMEM;

--
1.7.8.1


2012-01-08 20:37:12

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH] Bluetooth: dtl1: Fix memleak in probe()

Hi David,

On Sat, Jan 07, 2012, David Herrmann wrote:
> We currently leak the driver info structure if dtl1_config fails. If we add a
> kfree() to dtl1_release to fix this, then dtl1_release and dtl1_detach are
> identical so this merges both functions.
>
> Signed-off-by: David Herrmann <[email protected]>
> ---
> drivers/bluetooth/dtl1_cs.c | 20 +++-----------------
> 1 files changed, 3 insertions(+), 17 deletions(-)

Applied to my bluetooth-next tree. Thanks.

Johan

2012-01-08 20:36:48

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH] Bluetooth: hci-uart-ath: Use GFP_ATOMIC in open()

Hi David,

On Sat, Jan 07, 2012, David Herrmann wrote:
> The uart_proto open() callback is not called in atomic context so we can safely
> sleep here. The caller hci_uart_set_proto() in hci_ldisc.c is an ioctl-handler
> and therefore can sleep.
>
> Signed-off-by: David Herrmann <[email protected]>
> ---
> drivers/bluetooth/hci_ath.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)

Applied to my bluetooth-next tree. Thanks.

Johan

2012-01-08 20:36:24

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH] Bluetooth: hci-uart-bcsp: Use GFP_ATOMIC in open()

Hi David,

On Sat, Jan 07, 2012, David Herrmann wrote:
> The uart_proto open() callback is not called in atomic context so we can safely
> sleep here. The caller hci_uart_set_proto() in hci_ldisc.c is an ioctl-handler
> and therefore can sleep.
>
> Signed-off-by: David Herrmann <[email protected]>
> ---
> drivers/bluetooth/hci_bcsp.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)

Applied to my bluetooth-next tree. Thanks.

Johan

2012-01-08 20:36:01

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH] Bluetooth: hci-uart-h4: Use GFP_ATOMIC in open()

Hi David,

On Sat, Jan 07, 2012, David Herrmann wrote:
> The uart_proto open() callback is not called in atomic context so we can safely
> sleep here. The caller hci_uart_set_proto() in hci_ldisc.c is an ioctl-handler
> and therefore can sleep.
>
> Signed-off-by: David Herrmann <[email protected]>
> ---
> drivers/bluetooth/hci_h4.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)

Applied to my bluetooth-next tree. Thanks.

Johan

2012-01-08 20:34:23

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH] Bluetooth: hci-uart-ll: Use GFP_ATOMIC in open()

Hi David,

On Sat, Jan 07, 2012, David Herrmann wrote:
> The uart_proto open() callback is not called in atomic context so we can safely
> sleep here. The caller hci_uart_set_proto() in hci_ldisc.c is an ioctl() handler
> and therefore can sleep.
>
> Signed-off-by: David Herrmann <[email protected]>
> ---
> drivers/bluetooth/hci_ll.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)

Applied to my bluetooth-next tree. Thanks.

Johan

2012-01-07 21:04:50

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH] Bluetooth: dtl1: Fix memleak in probe()

Hi David,

> We currently leak the driver info structure if dtl1_config fails. If we add a
> kfree() to dtl1_release to fix this, then dtl1_release and dtl1_detach are
> identical so this merges both functions.
>
> Signed-off-by: David Herrmann <[email protected]>
> ---
> drivers/bluetooth/dtl1_cs.c | 20 +++-----------------
> 1 files changed, 3 insertions(+), 17 deletions(-)

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

Regards

Marcel



2012-01-07 21:04:09

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH] Bluetooth: hci-uart-ath: Use GFP_ATOMIC in open()

Hi David,

> The uart_proto open() callback is not called in atomic context so we can safely
> sleep here. The caller hci_uart_set_proto() in hci_ldisc.c is an ioctl-handler
> and therefore can sleep.
>
> Signed-off-by: David Herrmann <[email protected]>
> ---
> drivers/bluetooth/hci_ath.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)

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

Regards

Marcel



2012-01-07 21:03:47

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH] Bluetooth: hci-uart-bcsp: Use GFP_ATOMIC in open()

Hi David,

> The uart_proto open() callback is not called in atomic context so we can safely
> sleep here. The caller hci_uart_set_proto() in hci_ldisc.c is an ioctl-handler
> and therefore can sleep.
>
> Signed-off-by: David Herrmann <[email protected]>
> ---
> drivers/bluetooth/hci_bcsp.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)

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

Regards

Marcel



2012-01-07 21:03:25

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH] Bluetooth: hci-uart-h4: Use GFP_ATOMIC in open()

Hi David,

> The uart_proto open() callback is not called in atomic context so we can safely
> sleep here. The caller hci_uart_set_proto() in hci_ldisc.c is an ioctl-handler
> and therefore can sleep.
>
> Signed-off-by: David Herrmann <[email protected]>
> ---
> drivers/bluetooth/hci_h4.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)

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

Regards

Marcel



2012-01-07 21:03:03

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH] Bluetooth: hci-uart-ll: Use GFP_ATOMIC in open()

Hi David,

> The uart_proto open() callback is not called in atomic context so we can safely
> sleep here. The caller hci_uart_set_proto() in hci_ldisc.c is an ioctl() handler
> and therefore can sleep.
>
> Signed-off-by: David Herrmann <[email protected]>
> ---
> drivers/bluetooth/hci_ll.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)

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

Regards

Marcel



2012-01-07 14:19:41

by David Herrmann

[permalink] [raw]
Subject: [PATCH] Bluetooth: dtl1: Fix memleak in probe()

We currently leak the driver info structure if dtl1_config fails. If we add a
kfree() to dtl1_release to fix this, then dtl1_release and dtl1_detach are
identical so this merges both functions.

Signed-off-by: David Herrmann <[email protected]>
---
drivers/bluetooth/dtl1_cs.c | 20 +++-----------------
1 files changed, 3 insertions(+), 17 deletions(-)

diff --git a/drivers/bluetooth/dtl1_cs.c b/drivers/bluetooth/dtl1_cs.c
index 969bb22..b2db5e9 100644
--- a/drivers/bluetooth/dtl1_cs.c
+++ b/drivers/bluetooth/dtl1_cs.c
@@ -83,9 +83,6 @@ typedef struct dtl1_info_t {


static int dtl1_config(struct pcmcia_device *link);
-static void dtl1_release(struct pcmcia_device *link);
-
-static void dtl1_detach(struct pcmcia_device *p_dev);


/* Transmit states */
@@ -579,8 +576,8 @@ static void dtl1_detach(struct pcmcia_device *link)
{
dtl1_info_t *info = link->priv;

- dtl1_release(link);
-
+ dtl1_close(info);
+ pcmcia_disable_device(link);
kfree(info);
}

@@ -619,21 +616,10 @@ static int dtl1_config(struct pcmcia_device *link)
return 0;

failed:
- dtl1_release(link);
+ dtl1_detach(link);
return -ENODEV;
}

-
-static void dtl1_release(struct pcmcia_device *link)
-{
- dtl1_info_t *info = link->priv;
-
- dtl1_close(info);
-
- pcmcia_disable_device(link);
-}
-
-
static const struct pcmcia_device_id dtl1_ids[] = {
PCMCIA_DEVICE_PROD_ID12("Nokia Mobile Phones", "DTL-1", 0xe1bfdd64, 0xe168480d),
PCMCIA_DEVICE_PROD_ID12("Nokia Mobile Phones", "DTL-4", 0xe1bfdd64, 0x9102bc82),
--
1.7.8.1

2012-01-07 14:19:40

by David Herrmann

[permalink] [raw]
Subject: [PATCH] Bluetooth: hci-uart-ath: Use GFP_ATOMIC in open()

The uart_proto open() callback is not called in atomic context so we can safely
sleep here. The caller hci_uart_set_proto() in hci_ldisc.c is an ioctl-handler
and therefore can sleep.

Signed-off-by: David Herrmann <[email protected]>
---
drivers/bluetooth/hci_ath.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/bluetooth/hci_ath.c b/drivers/bluetooth/hci_ath.c
index 4093935..12172a6 100644
--- a/drivers/bluetooth/hci_ath.c
+++ b/drivers/bluetooth/hci_ath.c
@@ -112,7 +112,7 @@ static int ath_open(struct hci_uart *hu)

BT_DBG("hu %p", hu);

- ath = kzalloc(sizeof(*ath), GFP_ATOMIC);
+ ath = kzalloc(sizeof(*ath), GFP_KERNEL);
if (!ath)
return -ENOMEM;

--
1.7.8.1

2012-01-07 14:19:39

by David Herrmann

[permalink] [raw]
Subject: [PATCH] Bluetooth: hci-uart-bcsp: Use GFP_ATOMIC in open()

The uart_proto open() callback is not called in atomic context so we can safely
sleep here. The caller hci_uart_set_proto() in hci_ldisc.c is an ioctl-handler
and therefore can sleep.

Signed-off-by: David Herrmann <[email protected]>
---
drivers/bluetooth/hci_bcsp.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/bluetooth/hci_bcsp.c b/drivers/bluetooth/hci_bcsp.c
index 9c5b2dc..8bf0c3e 100644
--- a/drivers/bluetooth/hci_bcsp.c
+++ b/drivers/bluetooth/hci_bcsp.c
@@ -692,7 +692,7 @@ static int bcsp_open(struct hci_uart *hu)

BT_DBG("hu %p", hu);

- bcsp = kzalloc(sizeof(*bcsp), GFP_ATOMIC);
+ bcsp = kzalloc(sizeof(*bcsp), GFP_KERNEL);
if (!bcsp)
return -ENOMEM;

--
1.7.8.1

2012-01-07 14:19:38

by David Herrmann

[permalink] [raw]
Subject: [PATCH] Bluetooth: hci-uart-h4: Use GFP_ATOMIC in open()

The uart_proto open() callback is not called in atomic context so we can safely
sleep here. The caller hci_uart_set_proto() in hci_ldisc.c is an ioctl-handler
and therefore can sleep.

Signed-off-by: David Herrmann <[email protected]>
---
drivers/bluetooth/hci_h4.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/bluetooth/hci_h4.c b/drivers/bluetooth/hci_h4.c
index 2fcd8b3..7483294 100644
--- a/drivers/bluetooth/hci_h4.c
+++ b/drivers/bluetooth/hci_h4.c
@@ -69,7 +69,7 @@ static int h4_open(struct hci_uart *hu)

BT_DBG("hu %p", hu);

- h4 = kzalloc(sizeof(*h4), GFP_ATOMIC);
+ h4 = kzalloc(sizeof(*h4), GFP_KERNEL);
if (!h4)
return -ENOMEM;

--
1.7.8.1