staging: wilc1000: correctly check if associatedsta has not been found
The current check for associatedsta being set to -1 to indicate it has not been found is not working because associatedsta is initialized to zero and will never be -1. Fix this by initializing it to ~0 and checking for ~0 instead. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
23436825e6
commit
6c08fda030
1 changed files with 2 additions and 2 deletions
|
@ -1191,7 +1191,7 @@ static int get_station(struct wiphy *wiphy, struct net_device *dev,
|
||||||
struct wilc_priv *priv;
|
struct wilc_priv *priv;
|
||||||
struct wilc_vif *vif;
|
struct wilc_vif *vif;
|
||||||
u32 i = 0;
|
u32 i = 0;
|
||||||
u32 associatedsta = 0;
|
u32 associatedsta = ~0;
|
||||||
u32 inactive_time = 0;
|
u32 inactive_time = 0;
|
||||||
priv = wiphy_priv(wiphy);
|
priv = wiphy_priv(wiphy);
|
||||||
vif = netdev_priv(dev);
|
vif = netdev_priv(dev);
|
||||||
|
@ -1204,7 +1204,7 @@ static int get_station(struct wiphy *wiphy, struct net_device *dev,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (associatedsta == -1) {
|
if (associatedsta == ~0) {
|
||||||
netdev_err(dev, "sta required is not associated\n");
|
netdev_err(dev, "sta required is not associated\n");
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue