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>
This commit is contained in:
Lynn Lei 2017-08-08 23:05:59 +08:00 committed by Greg Kroah-Hartman
parent 33ebca0d05
commit b5956dd26f

View file

@ -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));