summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorPan Bian <bianpan2016@163.com>2017-10-29 14:57:22 +0100
committerDavid S. Miller <davem@davemloft.net>2017-11-01 04:11:02 +0100
commit7db8874abd9a134821881bb99301b3afbbe9b080 (patch)
tree1698685a82202bda42e63aaa2f3ce863624af058 /drivers/net
parentbpf: remove SK_REDIRECT from UAPI (diff)
downloadlinux-7db8874abd9a134821881bb99301b3afbbe9b080.tar.xz
linux-7db8874abd9a134821881bb99301b3afbbe9b080.zip
net: lapbether: fix double free
The function netdev_priv() returns the private data of the device. The memory to store the private data is allocated in alloc_netdev() and is released in netdev_free(). Calling kfree() on the return value of netdev_priv() after netdev_free() results in a double free bug. Signed-off-by: Pan Bian <bianpan2016@163.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wan/lapbether.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c
index 63f749078a1f..0e3f8ed84660 100644
--- a/drivers/net/wan/lapbether.c
+++ b/drivers/net/wan/lapbether.c
@@ -346,7 +346,6 @@ out:
fail:
dev_put(dev);
free_netdev(ndev);
- kfree(lapbeth);
goto out;
}