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

Dan Williams dcbw at redhat.com
Mon May 12 12:34:16 EDT 2008


On Sat, 2008-05-10 at 09:24 +0200, Sebastian Siewior wrote:
> From: Sebastian Siewior <sebastian at breakpoint.cc>
> 
> 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 at breakpoint.cc>
> ---
> 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)
> +

We usually use

if (!priv->mesh_dev)

for checking whether mesh is open or not... Will that not work here?

Dan

> 			return -EOPNOTSUPP;
> +
>  		return MESH_STATS_NUM;
>  	default:
>  		return -EOPNOTSUPP;




More information about the libertas-dev mailing list