Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1706641 > unrolled thread

[PATCH] drivers/staging/wlan-ng/p80211conv.c: fixed a potential memory leak

Started byLynn Lei <lynnl.yet@gmail.com>
First post2017-08-08 17:10 +0200
Last post2017-08-08 17:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] drivers/staging/wlan-ng/p80211conv.c: fixed a potential  memory leak Lynn Lei <lynnl.yet@gmail.com> - 2017-08-08 17:10 +0200

#1706641 — [PATCH] drivers/staging/wlan-ng/p80211conv.c: fixed a potential memory leak

FromLynn Lei <lynnl.yet@gmail.com>
Date2017-08-08 17:10 +0200
Subject[PATCH] drivers/staging/wlan-ng/p80211conv.c: fixed a potential memory leak
Message-ID<uceiR-1Ly-11@gated-at.bofh.it>
Fixed a potential memory leak inside skb_ether_to_p80211()
	When the wep_encrypt() fails  the code return 2 directly
	Which causes the p80211_wep->data dangling

Add a kfree statement to reclaim that memory allocated

Signed-off-by: Lynn Lei <lynnl.yet@gmail.com>
---
 drivers/staging/wlan-ng/p80211conv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/wlan-ng/p80211conv.c b/drivers/staging/wlan-ng/p80211conv.c
index fc8ad33ade9f..c1b6d426bcad 100644
--- a/drivers/staging/wlan-ng/p80211conv.c
+++ b/drivers/staging/wlan-ng/p80211conv.c
@@ -213,6 +213,7 @@ int skb_ether_to_p80211(struct wlandevice *wlandev, u32 ethconv,
 			netdev_warn(wlandev->netdev,
 				    "Host en-WEP failed, dropping frame (%d).\n",
 				    foo);
+			kfree(p80211_wep->data);
 			return 2;
 		}
 		fc |= cpu_to_le16(WLAN_SET_FC_ISWEP(1));
-- 
2.13.3

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web