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
2021-09-20 22:12:38 +05:30
committed by Madan Koyyalamudi
コミット db135c6eac

ファイルの表示

@@ -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);