From: Pan Bian Date: Sun, 29 Oct 2017 13:57:22 +0000 (+0800) Subject: net: lapbether: fix double free X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7db8874abd9a134821881bb99301b3afbbe9b080;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: David S. Miller --- 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; }