Browse Source

qcacmn: Add validity check in tdls deinit path

Add validity check in TDLS deinit path to avoid the
crash.

Change-Id: Id1b782c22346182e182e55557aa41dda99aa4c43
CRs-Fixed: 2151078
Kabilan Kannan 7 years ago
parent
commit
7efa6e4ab7
1 changed files with 4 additions and 0 deletions
  1. 4 0
      os_if/linux/tdls/src/wlan_cfg80211_tdls.c

+ 4 - 0
os_if/linux/tdls/src/wlan_cfg80211_tdls.c

@@ -78,6 +78,10 @@ QDF_STATUS wlan_cfg80211_tdls_priv_init(struct vdev_osif_priv *osif_priv)
 void wlan_cfg80211_tdls_priv_deinit(struct vdev_osif_priv *osif_priv)
 {
 	cfg80211_debug("deinitialize tdls os if layer private structure");
+	if (!osif_priv) {
+		cfg80211_err("OS private structure of vdev is null ");
+		return;
+	}
 	if (osif_priv->osif_tdls)
 		qdf_mem_free(osif_priv->osif_tdls);
 	osif_priv->osif_tdls = NULL;