Search Linux Wireless

[PATCH] [NET] libertas: check for mesh support before trying to use it

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Sebastian Siewior <sebastian@xxxxxxxxxxxxx>

This will prevent the execution of lbs_ethtool_get_stats() via ethtool -S
if there is no mesh support.

Signed-off-by: Sebastian Siewior <sebastian@xxxxxxxxxxxxx>
---
Dan, this will test prevent the usage of ethtool -S in case there is no
mesh support. If you fine with this than we could apply my or David's
other patch to enable the function again and then worry about the error
path.
David: I saw your patch that is doing this in a other way but I thing
that one looks better :)

 drivers/net/wireless/libertas/ethtool.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/libertas/ethtool.c b/drivers/net/wireless/libertas/ethtool.c
index dcfdb40..a79d698 100644
--- a/drivers/net/wireless/libertas/ethtool.c
+++ b/drivers/net/wireless/libertas/ethtool.c
@@ -113,8 +113,14 @@ static void lbs_ethtool_get_stats(struct net_device * dev,
 
 static int lbs_ethtool_get_sset_count(struct net_device * dev, int sset)
 {
+	struct lbs_private *priv = dev->priv;
+
 	switch (sset) {
 	case ETH_SS_STATS:
+
+		if (!priv->mesh_tlv)
+			return -EOPNOTSUPP;
+
 		return MESH_STATS_NUM;
 	default:
 		return -EOPNOTSUPP;
-- 
1.5.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux