diff options
author | Geliang Tang <geliangtang@163.com> | 2015-09-30 12:48:50 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-10-05 12:05:41 +0200 |
commit | 9dc80a74313d2741e053a650942818a86f234fc9 (patch) | |
tree | 01ac890a14d3bf1c948647718201d961980cbc8c /drivers | |
parent | ppp: don't override sk->sk_state in pppoe_flush_dev() (diff) | |
download | linux-9dc80a74313d2741e053a650942818a86f234fc9.tar.xz linux-9dc80a74313d2741e053a650942818a86f234fc9.zip |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c b/drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c index 2c063b60db4b..66137ffea3f8 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c @@ -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; } |