diff options
author | Lokesh <l.kasana@samsung.com> | 2019-02-18 15:33:04 +0530 |
---|---|---|
committer | Lokesh <l.kasana@samsung.com> | 2019-02-18 15:54:34 +0530 |
commit | 9213fac0850e963c7c14a392e6c64792bb099e9d (patch) | |
tree | c6a2990810c3c002497c212aba447a46b419f126 /plugins | |
parent | 59296a074abb449c3a939d1effb4cacef14d79e0 (diff) | |
download | connman-9213fac0850e963c7c14a392e6c64792bb099e9d.tar.gz connman-9213fac0850e963c7c14a392e6c64792bb099e9d.tar.bz2 connman-9213fac0850e963c7c14a392e6c64792bb099e9d.zip |
Fix the dangling pointer(network) inside autosignalpoll_timeout().submit/tizen/20190218.125443accepted/tizen/unified/20190219.154224
Change-Id: I47d74342b861db29c2b36094539a84b73dce7e55
Signed-off-by: Lokesh <l.kasana@samsung.com>
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/wifi.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/plugins/wifi.c b/plugins/wifi.c index 71727e69..9b2e9e12 100644 --- a/plugins/wifi.c +++ b/plugins/wifi.c @@ -3535,20 +3535,21 @@ static int network_signalpoll(struct connman_network *network) static gboolean autosignalpoll_timeout(gpointer data) { - struct connman_network *network = data; - int ret = 0; + if (!automaxspeed_timeout) { + DBG("automaxspeed_timeout is found to be zero. i.e. currently in disconnected state. !!"); + return FALSE; + } - automaxspeed_timeout = 0; - ret = network_signalpoll(network); + struct connman_network *network = data; + int ret = network_signalpoll(network); if (ret < 0) { DBG("Fail to get max speed !!"); + automaxspeed_timeout = 0; return FALSE; } - automaxspeed_timeout = g_timeout_add_seconds(30, autosignalpoll_timeout, network); - - return FALSE; + return TRUE; } #endif @@ -3904,7 +3905,11 @@ static void interface_state(GSupplicantInterface *interface) if (!automaxspeed_timeout) { DBG("Going to start signalpoll timer!!"); - autosignalpoll_timeout(network); + int ret = network_signalpoll(network); + if (ret < 0) + DBG("Fail to get max speed !!"); + else + automaxspeed_timeout = g_timeout_add_seconds(30, autosignalpoll_timeout, network); } #else /* though it should be already stopped: */ |