From 4f8d6ba3531fc2d27d17a54e073e3db529fc1cf5 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Thu, 17 Mar 2011 14:28:10 +0200 Subject: [PATCH] Fix missing check for dev->up before calling init_adapter With some kernels and the right timing it is possible to get into the state where we get the local name but haven't yet gotten a DEVUP event. In such a case it is *not* ok to call init_adapter. --- plugins/hciops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/hciops.c b/plugins/hciops.c index c46465adc..4225cd8ed 100644 --- a/plugins/hciops.c +++ b/plugins/hciops.c @@ -1584,7 +1584,7 @@ static void read_local_name_complete(int index, read_local_name_rp *rp) hci_send_cmd(dev->sk, OGF_INFO_PARAM, OCF_READ_LOCAL_VERSION, 0, NULL); - if (!dev->pending) + if (!dev->pending && dev->up) init_adapter(index); } -- 2.47.3