浏览代码

qcacld-3.0: Unlock tdls mutex properly in few instances

TDLS mutex is not unlocked properly in few error instances.
Thus, the thread gets stuck.

The fix is to unlock mutex properly before returning.

Change-Id: Ic16015e568dd91af17b3bb1ba9b19722cb0f82d9
CRs-Fixed: 2026737
Nitesh Shah 8 年之前
父节点
当前提交
0bf768fe16
共有 2 个文件被更改,包括 5 次插入2 次删除
  1. 2 1
      core/hdd/src/wlan_hdd_assoc.c
  2. 3 1
      core/hdd/src/wlan_hdd_tdls.c

+ 2 - 1
core/hdd/src/wlan_hdd_assoc.c

@@ -3829,7 +3829,8 @@ hdd_roam_tdls_status_update_handler(hdd_adapter_t *pAdapter,
 					hdd_roam_deregister_tdlssta
 						(pAdapter,
 						pRoamInfo->staId);
-				    }
+				    } else
+					mutex_unlock(&pHddCtx->tdls_lock);
 				} else
 				    mutex_unlock(&pHddCtx->tdls_lock);
 

+ 3 - 1
core/hdd/src/wlan_hdd_tdls.c

@@ -438,12 +438,14 @@ static void wlan_hdd_tdls_discovery_timeout_peer_cb(void *userData)
 	pHddTdlsCtx = (tdlsCtx_t *) userData;
 
 	if ((NULL == pHddTdlsCtx) || (NULL == pHddTdlsCtx->pAdapter)) {
+		mutex_unlock(&pHddCtx->tdls_lock);
 		QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
 			  FL("pHddTdlsCtx or pAdapter points to NULL"));
 		return;
 	}
 
 	if (WLAN_HDD_ADAPTER_MAGIC != pHddTdlsCtx->pAdapter->magic) {
+		mutex_unlock(&pHddCtx->tdls_lock);
 		hdd_err("pAdapter has invalid magic");
 		return;
 	}
@@ -3846,7 +3848,7 @@ int wlan_hdd_tdls_add_station(struct wiphy *wiphy,
 		hdd_err(MAC_ADDRESS_STR " update %d not exist. return invalid",
 			MAC_ADDR_ARRAY(mac), update);
 		ret = -EINVAL;
-		goto rel_lock;
+		goto ret_status;
 	}
 
 	link_status = pTdlsPeer->link_status;