Commit 7db8874a authored by Pan Bian's avatar Pan Bian Committed by David S. Miller

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: default avatarPan Bian <bianpan2016@163.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 04686ef2
...@@ -346,7 +346,6 @@ static int lapbeth_new_device(struct net_device *dev) ...@@ -346,7 +346,6 @@ static int lapbeth_new_device(struct net_device *dev)
fail: fail:
dev_put(dev); dev_put(dev);
free_netdev(ndev); free_netdev(ndev);
kfree(lapbeth);
goto out; goto out;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment