summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>2012-07-11 09:59:40 +0300
committerDaniel Wagner <daniel.wagner@bmw-carit.de>2012-07-17 11:47:10 +0200
commit13f39a7a5b21c7088d584e015f44cad88def279b (patch)
tree3992eca598b9f33b8a4b4f0c38523245692c5974 /src
parent74d19997c964b60b9f94dc82b5531173f83c1081 (diff)
downloadconnman-13f39a7a5b21c7088d584e015f44cad88def279b.tar.gz
connman-13f39a7a5b21c7088d584e015f44cad88def279b.tar.bz2
connman-13f39a7a5b21c7088d584e015f44cad88def279b.zip
device: Do not set regdom when device is not powered
Fixes crash bug: connmand[6761]: plugins/ofono.c:get_properties_reply() /huawei_0 path /huawei_0 org.ofono.NetworkRegistration connmand[6761]: plugins/ofono.c:netreg_properties_reply() /huawei_0 connmand[6761]: plugins/ofono.c:netreg_update_regdom() /huawei_0 MobileContryCode 460 connmand[6761]: src/device.c:connman_device_ref_debug() 0x8686ac0 ref 3 by plugins/wifi.c:991:wifi_set_regdom() connmand[6761]: Aborting (signal 11) [src/connmand] connmand[6761]: ++++++++ backtrace ++++++++ connmand[6761]: #0 0xb7749400 in connmand[6761]: #1 0x806aa0b in g_supplicant_interface_set_country() at nat.c:0 connmand[6761]: #2 0x8062297 in wifi_set_regdom() at wifi.c:0 connmand[6761]: #3 0x80a607d in connman_technology_set_regdom() at ??:0 connmand[6761]: #4 0x806fefb in netreg_update_regdom() at ofono.c:0 connmand[6761]: #5 0x8071f3b in netreg_properties_reply() at ofono.c:0 connmand[6761]: #6 0x806f747 in get_properties_reply() at ofono.c:0 connmand[6761]: #7 0x4a374b62 in /usr/lib/libdbus-1.so.3 connmand[6761]: #8 0x4a3602b7 in /usr/lib/libdbus-1.so.3 connmand[6761]: #9 0x4a3639f5 in /usr/lib/libdbus-1.so.3 connmand[6761]: #10 0x8054250 in message_dispatch() at mainloop.c:0 connmand[6761]: #11 0x49f3e9d7 in /lib/libglib-2.0.so.0 connmand[6761]: #12 0x49f3de38 in /lib/libglib-2.0.so.0 connmand[6761]: #13 0x49f3e13e in /lib/libglib-2.0.so.0 connmand[6761]: #14 0x49f3e5a6 in /lib/libglib-2.0.so.0 connmand[6761]: #15 0x8053ab6 in main() at nat.c:0 connmand[6761]: #16 0x49cfc4c4 in /lib/libc.so.6 connmand[6761]: +++++++++++++++++++++++++++
Diffstat (limited to 'src')
-rw-r--r--src/device.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/device.c b/src/device.c
index 75fa7f7c..0fda950d 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1058,6 +1058,9 @@ int connman_device_set_regdom(struct connman_device *device,
if (device->driver == NULL || device->driver->set_regdom == NULL)
return -ENOTSUP;
+ if (device->powered == FALSE)
+ return -EINVAL;
+
return device->driver->set_regdom(device, alpha2);
}