summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2013-06-10 15:37:17 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2013-06-10 15:37:17 +0200
commit9b142a0aa5331190658eb27edd35ff10bf58e211 (patch)
treef3d3022761f5a1d9923a4319401bf996a356a5d9
parent0c94377134615841e1ec0a57bdf228bc3417d1b4 (diff)
downloadneard-9b142a0aa5331190658eb27edd35ff10bf58e211.tar.gz
neard-9b142a0aa5331190658eb27edd35ff10bf58e211.tar.bz2
neard-9b142a0aa5331190658eb27edd35ff10bf58e211.zip
adapter: Pass the right adapter index when auto powering adapters
When calling __near_netlink_adapter_enable(), adapter->idx is not yet set. The right adapter index to pass is the __near_adapter_create() argument.
-rw-r--r--src/adapter.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/adapter.c b/src/adapter.c
index c3785c6..e303b3a 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -611,7 +611,7 @@ struct near_adapter *__near_adapter_create(uint32_t idx,
powered_setting = near_setting_get_bool("DefaultPowered");
if (powered_setting == TRUE && powered == FALSE &&
- !__near_netlink_adapter_enable(adapter->idx, powered_setting))
+ !__near_netlink_adapter_enable(idx, powered_setting))
powered = TRUE;
DBG("Powered %d", powered);