qcacmn: Fix coding errors detected by gcc 5+

With gcc 5+ utilized for driver building, more coding errors are
detected, some of which are valid issues.

Fix all those errors in one shot.

Change-Id: I263c70d4bff9ec0c3076103001cd7f2ccc8e0d1a
CRs-Fixed: 2176076
diff --git a/umac/scan/dispatcher/src/wlan_scan_utils_api.c b/umac/scan/dispatcher/src/wlan_scan_utils_api.c
index a380bb6..237c42c 100644
--- a/umac/scan/dispatcher/src/wlan_scan_utils_api.c
+++ b/umac/scan/dispatcher/src/wlan_scan_utils_api.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -114,7 +114,7 @@
 {
 
 	if (entry1->cap_info.wlan_caps.ess !=
-	   entry1->cap_info.wlan_caps.ess)
+	   entry2->cap_info.wlan_caps.ess)
 		return false;
 
 	if (entry1->cap_info.wlan_caps.ess &&