ソースを参照

qcacld-3.0: Fix vdev ref leak in __iw_set_pno

In __iw_set_pno if memory allocation for data fails the vdev ref is
not released. Also the osif code uses WLAN_LEGACY_MAC_ID instead of
WLAN_OSIF_ID to take the vdev ref.

Fix the vdev ref leak and use WLAN_OSIF_ID to take vdev ref in
__iw_set_pno.

Change-Id: Ibb7e10ad51e36bbbcf4238aa099e2a05818ea1c1
CRs-Fixed: 2525960
Abhishek Singh 5 年 前
コミット
3755cdd182
1 ファイル変更4 行追加3 行削除
  1. 4 3
      core/hdd/src/wlan_hdd_wext.c

+ 4 - 3
core/hdd/src/wlan_hdd_wext.c

@@ -9271,7 +9271,7 @@ static int __iw_set_pno(struct net_device *dev,
 
 	vdev = wlan_objmgr_get_vdev_by_macaddr_from_pdev(hdd_ctx->pdev,
 							 dev->dev_addr,
-							 WLAN_LEGACY_MAC_ID);
+							 WLAN_OSIF_ID);
 	if (!vdev) {
 		hdd_err("vdev object is NULL");
 		return -EIO;
@@ -9282,7 +9282,8 @@ static int __iw_set_pno(struct net_device *dev,
 	data = qdf_mem_malloc(len);
 	if (!data) {
 		hdd_err("fail to allocate memory %zu", len);
-		return -EINVAL;
+		ret = -EINVAL;
+		goto exit;
 	}
 	qdf_mem_copy(data, extra, (len-1));
 	ptr = data;
@@ -9481,7 +9482,7 @@ static int __iw_set_pno(struct net_device *dev,
 	}
 
 exit:
-	wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_MAC_ID);
+	wlan_objmgr_vdev_release_ref(vdev, WLAN_OSIF_ID);
 
 	qdf_mem_free(data);
 	return ret;