Browse Source

qcacmn: Fix NPD in function os_if_nan_process_ndp_responder_req

While processing of NDP responder request if NDP response code is
accept NDI interface is must. Throw error if interface is not provided
and bail out of the function.

Change-Id: I7266e3c82062130f6dbeb078cddfaa15a87d9197
CRs-Fixed: 2247586
Naveen Rawat 6 years ago
parent
commit
93a3d3a358
1 changed files with 18 additions and 18 deletions
  1. 18 18
      src/os_if_nan.c

+ 18 - 18
src/os_if_nan.c

@@ -473,24 +473,24 @@ static int os_if_nan_process_ndp_responder_req(struct wlan_objmgr_psoc *psoc,
 	req.ndp_rsp = nla_get_u32(tb[QCA_WLAN_VENDOR_ATTR_NDP_RESPONSE_CODE]);
 
 	if (req.ndp_rsp == NAN_DATAPATH_RESPONSE_ACCEPT) {
-		if (tb[QCA_WLAN_VENDOR_ATTR_NDP_IFACE_STR]) {
-			iface_name =
-				nla_data(
-					tb[QCA_WLAN_VENDOR_ATTR_NDP_IFACE_STR]);
-
-			/* Check for an existing NAN interface */
-			nan_vdev = wlan_util_get_vdev_by_ifname(psoc,
-					iface_name, WLAN_NAN_ID);
-			if (!nan_vdev) {
-				cfg80211_err("NAN data iface %s not available",
-					iface_name);
-				return -ENODEV;
-			}
-
-			if (nan_vdev->vdev_mlme.vdev_opmode != QDF_NDI_MODE) {
-				cfg80211_err("Interface found is not NDI");
-				return -ENODEV;
-			}
+		if (!tb[QCA_WLAN_VENDOR_ATTR_NDP_IFACE_STR]) {
+			cfg80211_err("Interface not provided");
+			return -ENODEV;
+		}
+		iface_name = nla_data(tb[QCA_WLAN_VENDOR_ATTR_NDP_IFACE_STR]);
+
+		/* Check for an existing NAN interface */
+		nan_vdev = wlan_util_get_vdev_by_ifname(psoc, iface_name,
+							WLAN_NAN_ID);
+		if (!nan_vdev) {
+			cfg80211_err("NAN data iface %s not available",
+				     iface_name);
+			return -ENODEV;
+		}
+
+		if (nan_vdev->vdev_mlme.vdev_opmode != QDF_NDI_MODE) {
+			cfg80211_err("Interface found is not NDI");
+			return -ENODEV;
 		}
 	} else {