mirror of
https://github.com/torvalds/linux.git
synced 2024-11-27 14:41:39 +00:00
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>
This commit is contained in:
parent
04686ef299
commit
7db8874abd
@ -346,7 +346,6 @@ out:
|
||||
fail:
|
||||
dev_put(dev);
|
||||
free_netdev(ndev);
|
||||
kfree(lapbeth);
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user