[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <636eed156113df40f9dd5e696f0486f428aff590.1443638366.git.geliangtang@163.com>
Date: Wed, 30 Sep 2015 03:48:50 -0700
From: Geliang Tang <geliangtang@....com>
To: Tom Lendacky <thomas.lendacky@....com>
Cc: Geliang Tang <geliangtang@....com>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] 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@....com>
---
drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c b/drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c
index 2c063b6..66137ff 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;
}
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists