]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
drivers/staging/wlan-ng/p80211conv.c: fixed a potential memory leak
authorLynn Lei <lynnl.yet@gmail.com>
Tue, 8 Aug 2017 15:05:59 +0000 (23:05 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 18 Aug 2017 22:57:17 +0000 (15:57 -0700)
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>
drivers/staging/wlan-ng/p80211conv.c

index fc8ad33ade9ff6841ef4c36220467d13a79dd89a..c1b6d426bcad7d5e9252d8a29308dfe253d53f42 100644 (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));