Browse Source

qcacld-3.0: Add pointer sanity check for mac_phy_cap

Add pointer sanity check for mac_phy_cap in wma_update_hw_mode_list
as target_psoc_get_mac_phy_cap may return Null for mac_phy_cap

Change-Id: Id45b77fa4daf3df0680ee247355dbc87e0402dd9
CRs-Fixed: 2706156
Utkarsh Bhatnagar 4 years ago
parent
commit
7306d6ec05
1 changed files with 6 additions and 0 deletions
  1. 6 0
      core/wma/src/wma_main.c

+ 6 - 0
core/wma/src/wma_main.c

@@ -6410,6 +6410,12 @@ static QDF_STATUS wma_update_hw_mode_list(t_wma_handle *wma_handle,
 	num_hw_modes = target_psoc_get_num_hw_modes(tgt_hdl);
 	mac_phy_cap = target_psoc_get_mac_phy_cap(tgt_hdl);
 	tgt_cap_info = target_psoc_get_target_caps(tgt_hdl);
+
+	if (!mac_phy_cap) {
+		WMA_LOGE("mac_phy_cap Null");
+		return QDF_STATUS_E_FAILURE;
+	}
+
 	/*
 	 * This list was updated as part of service ready event. Re-populate
 	 * HW mode list from the device capabilities.