qcacmn: Free ML dev context memory in case of failure

Free ML dev context memory in case of failure

Change-Id: I2564cc5a3140f26e5b70c684879150debe009a29
CRs-Fixed: 2989084
This commit is contained in:
Himanshu Batra
2021-07-12 16:43:33 +05:30
committed by Madan Koyyalamudi
parent 8bc0945029
commit 8f056fe40e

View File

@@ -219,8 +219,11 @@ static QDF_STATUS mlo_dev_ctx_init(struct wlan_objmgr_vdev *vdev)
mlo_dev_lock_create(ml_dev);
if (wlan_vdev_mlme_get_opmode(vdev) == QDF_STA_MODE) {
ml_dev->sta_ctx = qdf_mem_malloc(sizeof(struct wlan_mlo_sta));
if (!ml_dev->sta_ctx)
if (!ml_dev->sta_ctx) {
mlo_dev_lock_destroy(ml_dev);
qdf_mem_free(ml_dev);
return QDF_STATUS_E_NOMEM;
}
} else if (wlan_vdev_mlme_get_opmode(vdev) == QDF_SAP_MODE) {
ml_dev->ap_ctx = qdf_mem_malloc(sizeof(struct wlan_mlo_ap));
if (!ml_dev->ap_ctx)