Browse Source

qcacmn: Set osif priv to NULL when vdev comp object create fails

In the normal execution osif priv is freed when the object manager
is freed. Whenever there is a error w.r.t to creation of vdev,
osifpriv is deleted as part of vdev destroy. When this error
propagated to caller. Caller tries to again free the osif_priv
in the error path.

Hence set osif priv to NULL in error case to prevent any double
free by caller.

Change-Id: Iaa074ad39aa473e99ab2fd7b14194422f19c168d
CRs-Fixed: 2467327
Jeevan Kukkalli 5 years ago
parent
commit
e454174cf6
1 changed files with 5 additions and 0 deletions
  1. 5 0
      umac/cmn_services/obj_mgr/src/wlan_objmgr_vdev_obj.c

+ 5 - 0
umac/cmn_services/obj_mgr/src/wlan_objmgr_vdev_obj.c

@@ -249,6 +249,11 @@ struct wlan_objmgr_vdev *wlan_objmgr_vdev_obj_create(
 		wlan_objmgr_vdev_obj_delete(vdev);
 		obj_mgr_err("VDEV comp objects creation failed for vdev-id:%d",
 			vdev->vdev_objmgr.vdev_id);
+		/*
+		 * Set params osifp to NULL as it is freed during vdev obj
+		 * delete, This prevents caller from performing double free.
+		 */
+		params->osifp = NULL;
 		return NULL;
 	}