Wifi-2529. SM crash when DM tries to re-spawn the SM process.

The earlier changes for detaching the nl sockets for SM activity
also included a small change to relocate the event subscription.
This relocation of code is causing the crash due to possible
NULL pointer dereference.
Reverting the event subscription relocation code to avoid the
continuous SM crash.

Signed-off-by: ravi vaishnav <ravi.vaishnav@netexperience.com>
This commit is contained in:
ravi vaishnav
2021-06-02 19:48:41 -04:00
committed by Rick Sommerville
parent 89640188c9
commit e528b832bb

View File

@@ -37,6 +37,7 @@
#include "radio.h"
extern struct ev_loop *wifihal_evloop;
static int nl80211_scan_started;
static struct unl unl_req;
static struct unl unl_notify;
static ev_io unl_io;
@@ -470,6 +471,14 @@ static struct nl_msg *nl80211_call_vif(struct nl_call_param *nl_call_param, int
int idx = if_nametoindex(nl_call_param->ifname);
struct nl_msg *msg;
if (!nl80211_scan_started) {
unl_genl_subscribe(&unl_notify, "scan");
ev_io_init(&unl_io, nl80211_ev, unl_notify.sock->s_fd, EV_READ);
ev_io_start(wifihal_evloop, &unl_io);
nl80211_scan_started = 1;
}
if (!idx)
return NULL;
@@ -610,10 +619,5 @@ int stats_nl80211_init(void)
if (nl_socket_set_nonblocking(unl_notify.sock))
LOGE("stats_nl80211: Failed to set stats nl socket in the non blocking mode");
unl_genl_subscribe(&unl_notify, "scan");
ev_io_init(&unl_io, nl80211_ev, unl_notify.sock->s_fd, EV_READ);
ev_io_start(wifihal_evloop, &unl_io);
return 0;
}