Skip to content

Commit

Permalink
amd-xgbe: fix potential memory leak in xgbe-debugfs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Geliang Tang authored and David S. Miller committed Oct 5, 2015
1 parent e674016 commit 9dc80a7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 9dc80a7

Please sign in to comment.