diff options
| author | Nachiket Kukade <nkukade@codeaurora.org> | 2018-09-24 16:15:58 +0530 |
|---|---|---|
| committer | nshrivas <nshrivas@codeaurora.org> | 2018-09-24 16:23:18 -0700 |
| commit | c837de1350128159f372d2bfe3f6372fc5ad60bb (patch) | |
| tree | 2cbcbb198d9ee94a43d204f9ea5fae4231679b04 | |
| parent | af52c7237527fda8334b11e8715c3173f7d9c9d0 (diff) | |
qcacld-3.0: Check NULL pointer of roam_profile
qcacld-3.2 to qcacld-3.1 propagation
__wlan_hdd_cfg80211_get_key was invoked when unloading driver.
SAP ctx had been freed at this time.wlan_sap_get_roam_profile will
return NULL.
Check NULL pointer before use roam_profile.
Change-Id: If1f11f0fb7027a6af4e3242fe9af722740d32850
CRs-Fixed: 2162395
| -rw-r--r-- | core/hdd/src/wlan_hdd_cfg80211.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index d0ad19e1f54d..26d16b9ffa81 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -15679,6 +15679,11 @@ static int __wlan_hdd_cfg80211_get_key(struct wiphy *wiphy, return -EINVAL; } + if (wlan_hdd_validate_session_id(pAdapter->sessionId)) { + hdd_err("Invalid session id: %d", pAdapter->sessionId); + return -EINVAL; + } + hdd_debug("Device_mode %s(%d)", hdd_device_mode_to_string(pAdapter->device_mode), pAdapter->device_mode); @@ -15690,6 +15695,11 @@ static int __wlan_hdd_cfg80211_get_key(struct wiphy *wiphy, return -EINVAL; } + if (pRoamProfile == NULL) { + hdd_err("Get roam profile failed!"); + return -EINVAL; + } + switch (pRoamProfile->EncryptionType.encryptionType[0]) { case eCSR_ENCRYPT_TYPE_NONE: params.cipher = IW_AUTH_CIPHER_NONE; |
