aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2012-02-24 12:53:22 +0200
committerJohan Hedberg <johan.hedberg@intel.com>2012-02-24 12:53:22 +0200
commite8d185f9dd114ecf623beda802ef374d655af586 (patch)
tree9b0d9464331b4e434222c9af68c1819e45f30497 /plugins
parent63e1b0396180a9b412729e7757da19141a097618 (diff)
downloadbluez-e8d185f9dd114ecf623beda802ef374d655af586.tar.gz
bluez-e8d185f9dd114ecf623beda802ef374d655af586.tar.xz
bluez-e8d185f9dd114ecf623beda802ef374d655af586.zip
mgmtops: Fix uninitialized discovery type value
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mgmtops.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/plugins/mgmtops.c b/plugins/mgmtops.c
index 2c062e51..5740e9c5 100644
--- a/plugins/mgmtops.c
+++ b/plugins/mgmtops.c
@@ -1846,20 +1846,19 @@ static int mgmt_start_discovery(int index)
struct mgmt_hdr *hdr = (void *) buf;
struct mgmt_cp_start_discovery *cp = (void *) &buf[sizeof(*hdr)];
struct controller_info *info = &controllers[index];
- uint8_t type;
DBG("index %d", index);
+ info->discov_type = 0;
+
if (mgmt_bredr(info->current_settings))
- hci_set_bit(MGMT_ADDR_BREDR, &type);
+ hci_set_bit(MGMT_ADDR_BREDR, &info->discov_type);
if (mgmt_low_energy(info->current_settings)) {
- hci_set_bit(MGMT_ADDR_LE_PUBLIC, &type);
- hci_set_bit(MGMT_ADDR_LE_RANDOM, &type);
+ hci_set_bit(MGMT_ADDR_LE_PUBLIC, &info->discov_type);
+ hci_set_bit(MGMT_ADDR_LE_RANDOM, &info->discov_type);
}
- info->discov_type = type;
-
memset(buf, 0, sizeof(buf));
hdr->opcode = htobs(MGMT_OP_START_DISCOVERY);
hdr->len = htobs(sizeof(*cp));