Ver Fonte

qcacmn: Fix use of uninitialized variable in phyerr processing

Initialize the variable "segid" to prevent the usage of junk value.
Dont dereference the spectral-lmac object if the same is NULL.

Change-Id: I5206a99017f77e5c94368d91171a7eb05745933c
Debasis Das há 3 anos atrás
pai
commit
db135c6eac
1 ficheiros alterados com 2 adições e 2 exclusões
  1. 2 2
      target_if/spectral/target_if_spectral_phyerr.c

+ 2 - 2
target_if/spectral/target_if_spectral_phyerr.c

@@ -1500,7 +1500,7 @@ target_if_process_phyerr_gen2(struct target_if_spectral *spectral,
 	struct spectral_process_phyerr_info_gen2 process_phyerr_fields;
 	struct spectral_process_phyerr_info_gen2 *phyerr_info =
 						&process_phyerr_fields;
-	uint8_t segid;
+	uint8_t segid = 0;
 	uint8_t segid_sec80;
 	enum phy_ch_width ch_width;
 	QDF_STATUS ret;
@@ -1508,7 +1508,7 @@ target_if_process_phyerr_gen2(struct target_if_spectral *spectral,
 
 	if (!spectral) {
 		spectral_err_rl("Spectral LMAC object is null");
-		goto fail_no_print;
+		return -EPERM;
 	}
 
 	p_sops = GET_TARGET_IF_SPECTRAL_OPS(spectral);