summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2016-09-09 15:56:38 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-09-12 09:19:42 (GMT)
commitaeaf5d86faa5d8c64674465da544c26c97e9404a (patch)
tree3289be7e7f9b88ba56e7a201438832b52c903375
parent8defffb20854500825162d336bdd183d2d218cf9 (diff)
downloadlinux-aeaf5d86faa5d8c64674465da544c26c97e9404a.tar.xz
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 <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/ks7010/ks_hostif.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
index c5fc31c..e09df360 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;
}