diff options
| author | Lynn Lei <lynnl.yet@gmail.com> | 2017-08-08 18:05:59 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-08-19 01:57:17 +0300 |
| commit | b5956dd26f848086af7413d8d089b4ab41ab341d (patch) | |
| tree | 7163fdc3600998d21fd7ed24271dd3039227bff0 | |
| parent | 33ebca0d0538eec224e1fba378f01d5225740f2f (diff) | |
| download | linux-b5956dd26f848086af7413d8d089b4ab41ab341d.tar.xz | |
drivers/staging/wlan-ng/p80211conv.c: fixed a potential memory leak
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | drivers/staging/wlan-ng/p80211conv.c | 1 |
1 files changed, 1 insertions, 0 deletions
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)); |
