Ver código fonte

qcacmn: Fix incorrect status initialization

Initialize status to QDF_STATUS_SUCCESS in populate_hw_mode_capability
and populate_phy_reg_capability and update both functions to return
qdf_status_to_os_return(status). This will ensure in non-failure scenario
function always returns SUCCESS.

Change-Id: Ie3a44baad9e9f52b74e1bd78802c54b0371a22ed
CRs-Fixed: 2013723
Krishna Kumaar Natarajan 8 anos atrás
pai
commit
3064cd6aab

+ 3 - 3
target_if/init_deinit/src/service_ready_event_handler.c

@@ -192,7 +192,7 @@ static int populate_hw_mode_capability(void *wmi_handle,
 			uint8_t *event, uint8_t *total_mac_phy,
 			struct ext_service_ready_param *service_param)
 {
-	QDF_STATUS status = QDF_STATUS_E_FAILURE;
+	QDF_STATUS status = QDF_STATUS_SUCCESS;
 	uint8_t hw_idx;
 	uint32_t num_hw_modes;
 
@@ -225,7 +225,7 @@ static int populate_phy_reg_capability(void *handle, uint8_t *event,
 {
 	uint8_t reg_idx;
 	uint32_t num_phy_reg_cap;
-	QDF_STATUS status = QDF_STATUS_E_FAILURE;
+	QDF_STATUS status = QDF_STATUS_SUCCESS;
 
 	num_phy_reg_cap = service_param->service_ext_param.num_phy;
 	if (num_phy_reg_cap > MAX_PHY_REG_CAP) {
@@ -243,7 +243,7 @@ static int populate_phy_reg_capability(void *handle, uint8_t *event,
 		}
 	}
 
-	return 0;
+	return qdf_status_to_os_return(status);
 }
 
 int init_deinit_service_ext_ready_event_handler(ol_scn_t scn_handle,