summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSubhani Shaik <subhanis@codeaurora.org>2017-08-11 11:39:06 -0700
committerEcco Park <eccopark@google.com>2017-08-11 12:28:40 -0700
commit111c8ab79807364ea73359b84951031c43a1ec4a (patch)
tree40017705de7942d14d63428dfd177666cf90eab1
parent9aebcc18e7228ae1aaf9b4ca8706cb2aa632c0b2 (diff)
downloadandroid_hardware_qcom_wlan-111c8ab79807364ea73359b84951031c43a1ec4a.tar.gz
android_hardware_qcom_wlan-111c8ab79807364ea73359b84951031c43a1ec4a.tar.bz2
android_hardware_qcom_wlan-111c8ab79807364ea73359b84951031c43a1ec4a.zip
cld80211lib: Remove sendmsg to driver during cleanup
The get_multicast_id initiates a sendmsg to the driver and waits in busywait to receive the msg. In certain failures where driver is stopped prior to cleanup, the error handler is not returning to terminate the bsywait. Subsequently we don't send a cleanup notification to the framework. This triggers a subsequent start of HAL interface and a hang state. Bug: 64350646 Change-Id: I4cb078a98830f667beceb78a356cd7a4808b2f73
-rw-r--r--cld80211-lib/cld80211_lib.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/cld80211-lib/cld80211_lib.c b/cld80211-lib/cld80211_lib.c
index 491fb3e..5c8255b 100644
--- a/cld80211-lib/cld80211_lib.c
+++ b/cld80211-lib/cld80211_lib.c
@@ -225,7 +225,7 @@ static int family_handler(struct nl_msg *msg, void *arg)
}
-static int get_multicast_id(struct cld80211_ctx *ctx, const char *group)
+static int get_multicast_id(struct cld80211_ctx *ctx, const char *group, bool sync_driver)
{
struct family_data res = { group, -ENOENT };
struct nl_msg *nlmsg = nlmsg_alloc();
@@ -238,9 +238,11 @@ static int get_multicast_id(struct cld80211_ctx *ctx, const char *group)
CTRL_CMD_GETFAMILY, 0);
nla_put_string(nlmsg, CTRL_ATTR_FAMILY_NAME, "cld80211");
- cld80211_send_recv_msg(ctx, nlmsg, family_handler, &res);
- ALOGI("%s: nlctrl family id: %d group: %s mcast_id: %d", getprogname(),
- ctx->nlctrl_familyid, group, res.id);
+ if (sync_driver == true) {
+ cld80211_send_recv_msg(ctx, nlmsg, family_handler, &res);
+ ALOGI("%s: nlctrl family id: %d group: %s mcast_id: %d", getprogname(),
+ ctx->nlctrl_familyid, group, res.id);
+ }
nlmsg_free(nlmsg);
return res.id;
}
@@ -252,7 +254,7 @@ int cld80211_add_mcast_group(struct cld80211_ctx *ctx, const char* mcgroup)
ALOGE("%s: ctx/mcgroup is NULL: %s", getprogname(), __func__);
return 0;
}
- int id = get_multicast_id(ctx, mcgroup);
+ int id = get_multicast_id(ctx, mcgroup, true);
if (id < 0) {
ALOGE("%s: Could not find group %s, errno: %d id: %d",
getprogname(), mcgroup, errno, id);
@@ -275,7 +277,7 @@ int cld80211_remove_mcast_group(struct cld80211_ctx *ctx, const char* mcgroup)
ALOGE("%s: ctx/mcgroup is NULL: %s", getprogname(), __func__);
return 0;
}
- int id = get_multicast_id(ctx, mcgroup);
+ int id = get_multicast_id(ctx, mcgroup, false);
if (id < 0) {
ALOGE("%s: Could not find group %s, errno: %d id: %d",
getprogname(), mcgroup, errno, id);