From: Daniel Drake <dsd@laptop.org>
Date: Wed, 24 Nov 2010 16:00:49 +0000 (+0000)
Subject: libertas: fix memory corruption in lbs_remove_card()
X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=517ff43146b17a0d067125f098f675d1e0ac2d82;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git

libertas: fix memory corruption in lbs_remove_card()

"priv" is stored at the end of the wiphy structure, which is freed
during the call to lbs_cfg_free(). It must not be touched afterwards.

Remove the unnecessary NULL assignment causing this memory corruption.

Signed-off-by: Daniel Drake <dsd@laptop.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---

diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index 46b88b118c99..fcd1bbfc632d 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -915,8 +915,6 @@ void lbs_remove_card(struct lbs_private *priv)
 
 	lbs_free_adapter(priv);
 	lbs_cfg_free(priv);
-
-	priv->dev = NULL;
 	free_netdev(dev);
 
 	lbs_deb_leave(LBS_DEB_MAIN);