From: Dmitry Shmidt Date: Mon, 17 Oct 2011 00:12:29 +0000 (-0700) Subject: net: wireless: bcmdhd: Add proper cleaning for ap_info structure X-Git-Tag: 2.1b_release~2254 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=642cb163e2924ee449758775a0fded15ab3918a8;p=kernel%2Fkernel-mfld-blackbay.git net: wireless: bcmdhd: Add proper cleaning for ap_info structure Signed-off-by: Dmitry Shmidt --- diff --git a/drivers/net/wireless/bcmdhd/wl_cfg80211.c b/drivers/net/wireless/bcmdhd/wl_cfg80211.c index 00cbfaf..2703784 100644 --- a/drivers/net/wireless/bcmdhd/wl_cfg80211.c +++ b/drivers/net/wireless/bcmdhd/wl_cfg80211.c @@ -3858,9 +3858,18 @@ wl_cfg80211_add_set_beacon(struct wiphy *wiphy, struct net_device *dev, return BCME_ERROR; } wl->ap_info->security_mode = true; - kfree(wl->ap_info->rsn_ie); - kfree(wl->ap_info->wpa_ie); - kfree(wl->ap_info->wps_ie); + if (wl->ap_info->rsn_ie) { + kfree(wl->ap_info->rsn_ie); + wl->ap_info->rsn_ie = NULL; + } + if (wl->ap_info->wpa_ie) { + kfree(wl->ap_info->wpa_ie); + wl->ap_info->wpa_ie = NULL; + } + if (wl->ap_info->wps_ie) { + kfree(wl->ap_info->wps_ie); + wl->ap_info->wps_ie = NULL; + } if (wpa_ie != NULL) { /* WPAIE */ wl->ap_info->rsn_ie = NULL; diff --git a/drivers/net/wireless/bcmdhd/wl_cfgp2p.c b/drivers/net/wireless/bcmdhd/wl_cfgp2p.c index 0251d82..4ee6557 100644 --- a/drivers/net/wireless/bcmdhd/wl_cfgp2p.c +++ b/drivers/net/wireless/bcmdhd/wl_cfgp2p.c @@ -112,6 +112,7 @@ wl_cfgp2p_deinit_priv(struct wl_priv *wl) { if (wl->p2p) { kfree(wl->p2p); + wl->p2p = NULL; } wl->p2p_supported = 0; }