forked from Minki/linux
amd-xgbe: fix potential memory leak in xgbe-debugfs
Added kfree() to avoid the memory leak when debugfs_create_dir() fails. Signed-off-by: Geliang Tang <geliangtang@163.com> Acked-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
e6740165b8
commit
9dc80a7431
@ -330,6 +330,7 @@ void xgbe_debugfs_init(struct xgbe_prv_data *pdata)
|
||||
pdata->xgbe_debugfs = debugfs_create_dir(buf, NULL);
|
||||
if (!pdata->xgbe_debugfs) {
|
||||
netdev_err(pdata->netdev, "debugfs_create_dir failed\n");
|
||||
kfree(buf);
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user