qcacmn: Check param_buf->hal_reg_caps before dereferencing it

While handling the WMI_SERVICE_READY_EXT_EVENTID WMI FW event, a NULL
pointer dereference can occur if param_buf->hal_reg_caps is not checked.

Check param_buf->hal_reg_caps before dereferencing it to avoid NULL
pointer dereference.

Change-Id: I00eba5e89fbdde78979d19f492df5ad4dca8b80c
CRs-Fixed: 2347673
This commit is contained in:
bings
2018-11-27 14:45:14 +08:00
committad av nshrivas
förälder 7d6957294f
incheckning 53262f1d1f

Visa fil

@@ -9379,6 +9379,9 @@ static QDF_STATUS extract_reg_cap_service_ready_ext_tlv(
if (phy_idx >= reg_caps->num_phy)
return QDF_STATUS_E_INVAL;
if (!param_buf->hal_reg_caps)
return QDF_STATUS_E_INVAL;
ext_reg_cap = &param_buf->hal_reg_caps[phy_idx];
param->phy_id = ext_reg_cap->phy_id;