From: Colin Ian King Date: Fri, 9 Sep 2016 15:56:38 +0000 (+0100) Subject: staging: ks7010: fix two memory leaks on error return path X-Git-Tag: v4.9-rc1~119^2~741 X-Git-Url: http://git.cascardo.eti.br/?a=commitdiff_plain;h=aeaf5d86faa5d8c64674465da544c26c97e9404a;p=cascardo%2Flinux.git staging: ks7010: fix two memory leaks on error return path On the error case where there is an invalid MAC address there is memory leak on packet and pp on the error return. Free these first before returning to fix the leak. Signed-off-by: Colin Ian King Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c index c5fc31c0038d..e09df36016ad 100644 --- a/drivers/staging/ks7010/ks_hostif.c +++ b/drivers/staging/ks7010/ks_hostif.c @@ -1196,6 +1196,8 @@ int hostif_data_request(struct ks_wlan_private *priv, struct sk_buff *packet) DPRINTK(1, "ethernet->h_source=%02X:%02X:%02X:%02X:%02X:%02X\n", eth->h_source[0], eth->h_source[1], eth->h_source[2], eth->h_source[3], eth->h_source[4], eth->h_source[5]); + dev_kfree_skb(packet); + kfree(pp); return -3; }