am 6a115696: (-s ours) driver_wext: Add "HANGED" processing (b/2310372) (DO NOT MERGE)

Merge commit '6a115696c36f5e76efd18342af10953f5d8da914' into eclair-mr2

* commit '6a115696c36f5e76efd18342af10953f5d8da914':
  driver_wext: Add "HANGED" processing (b/2310372) (DO NOT MERGE)
diff --git a/os_unix.c b/os_unix.c
index edb160a..8498b15 100644
--- a/os_unix.c
+++ b/os_unix.c
@@ -181,7 +181,7 @@
 	/* We ignore errors here since errors are normal if we
 	 * are already running as non-root.
 	 */
-	gid_t groups[] = { AID_INET, AID_WIFI, AID_KEYSTORE };
+	gid_t groups[] = { AID_INET, AID_WIFI };
 	setgroups(sizeof(groups)/sizeof(groups[0]), groups);
 
 	prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0);
diff --git a/wpa_ctrl.c b/wpa_ctrl.c
index 32866cf..3c61b27 100644
--- a/wpa_ctrl.c
+++ b/wpa_ctrl.c
@@ -140,8 +140,11 @@
 
 void wpa_ctrl_close(struct wpa_ctrl *ctrl)
 {
+	if (ctrl == NULL)
+		return;
 	unlink(ctrl->local.sun_path);
-	close(ctrl->s);
+	if (ctrl->s >= 0)
+		close(ctrl->s);
 	os_free(ctrl);
 }