linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: Fix unconditional call to mgmt interface in hci_event.c
@ 2011-04-06 11:02 Szymon Janc
  2011-04-06 14:08 ` Marcel Holtmann
  0 siblings, 1 reply; 3+ messages in thread
From: Szymon Janc @ 2011-04-06 11:02 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: par-gunnar.p.hjalmdahl, henrik.possung, Szymon Janc

hci_cc_read_local_oob_data_reply funtion should call
mgmt_read_local_oob_data_reply_complete only if management interface
is enabled.

Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
---
 net/bluetooth/hci_event.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 7a3398d..9062e1b 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -831,7 +831,8 @@ static void hci_cc_read_local_oob_data_reply(struct hci_dev *hdev,
 
 	BT_DBG("%s status 0x%x", hdev->name, rp->status);
 
-	mgmt_read_local_oob_data_reply_complete(hdev->id, rp->hash,
+	if (test_bit(HCI_MGMT, &hdev->flags))
+		mgmt_read_local_oob_data_reply_complete(hdev->id, rp->hash,
 						rp->randomizer, rp->status);
 }
 
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Bluetooth: Fix unconditional call to mgmt interface in hci_event.c
  2011-04-06 11:02 [PATCH] Bluetooth: Fix unconditional call to mgmt interface in hci_event.c Szymon Janc
@ 2011-04-06 14:08 ` Marcel Holtmann
  2011-04-07  6:26   ` Szymon Janc
  0 siblings, 1 reply; 3+ messages in thread
From: Marcel Holtmann @ 2011-04-06 14:08 UTC (permalink / raw)
  To: Szymon Janc; +Cc: linux-bluetooth, par-gunnar.p.hjalmdahl, henrik.possung

Hi Szymon,

> hci_cc_read_local_oob_data_reply funtion should call
> mgmt_read_local_oob_data_reply_complete only if management interface
> is enabled.
> 
> Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
> ---
>  net/bluetooth/hci_event.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
> index 7a3398d..9062e1b 100644
> --- a/net/bluetooth/hci_event.c
> +++ b/net/bluetooth/hci_event.c
> @@ -831,7 +831,8 @@ static void hci_cc_read_local_oob_data_reply(struct hci_dev *hdev,
>  
>  	BT_DBG("%s status 0x%x", hdev->name, rp->status);
>  

please just exit the function if flag is not set:

	if (!test_bit(...))
		return

> -	mgmt_read_local_oob_data_reply_complete(hdev->id, rp->hash,
> +	if (test_bit(HCI_MGMT, &hdev->flags))
> +		mgmt_read_local_oob_data_reply_complete(hdev->id, rp->hash,
>  						rp->randomizer, rp->status);
>  }
>  

Regards

Marcel



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Bluetooth: Fix unconditional call to mgmt interface in hci_event.c
  2011-04-06 14:08 ` Marcel Holtmann
@ 2011-04-07  6:26   ` Szymon Janc
  0 siblings, 0 replies; 3+ messages in thread
From: Szymon Janc @ 2011-04-07  6:26 UTC (permalink / raw)
  To: Marcel Holtmann
  Cc: linux-bluetooth@vger.kernel.org,
	par-gunnar.p.hjalmdahl@stericsson.com,
	henrik.possung@stericsson.com

> Hi Szymon,

Hi Marcel,

> please just exit the function if flag is not set:
> 
> 	if (!test_bit(...))
> 		return
> 
> > -	mgmt_read_local_oob_data_reply_complete(hdev->id, rp->hash,
> > +	if (test_bit(HCI_MGMT, &hdev->flags))
> > +		mgmt_read_local_oob_data_reply_complete(hdev->id, rp->hash,
> >  						rp->randomizer, rp->status);
> >  }

Other hci_cc_*_reply functions do
    if (test_bit(..))
        mgmt_call();

I'd prefer to keep the same convention for all of them.

BR,
Szymon Janc

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-04-07  6:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-06 11:02 [PATCH] Bluetooth: Fix unconditional call to mgmt interface in hci_event.c Szymon Janc
2011-04-06 14:08 ` Marcel Holtmann
2011-04-07  6:26   ` Szymon Janc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).