[RFC] [NET] libertas: fix ethtool -S

Sebastian Siewior bigeasy at tglx.de
Wed Mar 5 05:28:26 EST 2008


First of all we memset the memory incase of an error in order not leak
anything to the user space. Using kzalloc in first place might be another
sollution.
And then I tried to put the correct request to the hardware what got
broken in 301eacbf30e33f461701df91cb250d3fc24c5fe5

Signed-off-by: Sebastian Siewior <bigeasy at linutronix.de>
---
 drivers/net/wireless/libertas/ethtool.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/libertas/ethtool.c b/drivers/net/wireless/libertas/ethtool.c
index 21e6f98..b204d71 100644
--- a/drivers/net/wireless/libertas/ethtool.c
+++ b/drivers/net/wireless/libertas/ethtool.c
@@ -116,12 +116,11 @@ static void lbs_ethtool_get_stats(struct net_device * dev,
 	lbs_deb_enter(LBS_DEB_ETHTOOL);
 
 	/* Get Mesh Statistics */
-	ret = lbs_prepare_and_send_command(priv,
-			CMD_MESH_ACCESS, CMD_ACT_MESH_GET_STATS,
-			CMD_OPTION_WAITFORRSP, 0, &mesh_access);
-
-	if (ret)
+	ret = lbs_mesh_access(priv, CMD_ACT_MESH_GET_STATS, &mesh_access);
+	if (ret) {
+		memset(data, 0, 8 * sizeof(u64));
 		return;
+	}
 
 	priv->mstats.fwd_drop_rbt = le32_to_cpu(mesh_access.data[0]);
 	priv->mstats.fwd_drop_ttl = le32_to_cpu(mesh_access.data[1]);
-- 
1.5.3.5




More information about the libertas-dev mailing list