linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] adapter: Fix registering adapter with no address
@ 2013-02-08 10:03 Szymon Janc
  2013-02-15 12:22 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Szymon Janc @ 2013-02-08 10:03 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

adapter->bdaddr is set later in read_info_complete and current check
always returns false. Check against bdaddr received in command response
instead and fail if it is all zeros.
---
 src/adapter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/adapter.c b/src/adapter.c
index 9ddd2fc..5165bed 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -5727,7 +5727,7 @@ static void read_info_complete(uint8_t status, uint16_t length,
 		goto failed;
 	}
 
-	if (bacmp(&adapter->bdaddr, BDADDR_ANY)) {
+	if (bacmp(&rp->bdaddr, BDADDR_ANY) == 0) {
 		error("No Bluetooth address for index %u", adapter->dev_id);
 		goto failed;
 	}
-- 
1.8.1.1


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

* Re: [PATCH] adapter: Fix registering adapter with no address
  2013-02-08 10:03 [PATCH] adapter: Fix registering adapter with no address Szymon Janc
@ 2013-02-15 12:22 ` Johan Hedberg
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2013-02-15 12:22 UTC (permalink / raw)
  To: Szymon Janc; +Cc: linux-bluetooth

Hi Szymon,

On Fri, Feb 08, 2013, Szymon Janc wrote:
> adapter->bdaddr is set later in read_info_complete and current check
> always returns false. Check against bdaddr received in command response
> instead and fail if it is all zeros.
> ---
>  src/adapter.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied. Thanks.

Johan

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

end of thread, other threads:[~2013-02-15 12:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-08 10:03 [PATCH] adapter: Fix registering adapter with no address Szymon Janc
2013-02-15 12:22 ` Johan Hedberg

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).