From 13f39a7a5b21c7088d584e015f44cad88def279b Mon Sep 17 00:00:00 2001 From: Tomasz Bursztyka Date: Wed, 11 Jul 2012 09:59:40 +0300 Subject: 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]: +++++++++++++++++++++++++++ --- src/device.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/device.c') 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); } -- cgit v1.2.3