mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-12 15:49:17 -04:00
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
This commit is contained in:
parent
70ebc4e9ff
commit
3755cdd182
1 changed files with 4 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue