diff options
author | Colin Ian King <colin.king@canonical.com> | 2016-08-15 12:09:52 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-08-21 11:28:21 -0400 |
commit | 6c08fda0306916135291103f23cc17248c422c49 (patch) | |
tree | 0e04c8d02c6eab8cb173a8848196b4c00f8153e1 | |
parent | 23436825e671cdd55c45d151ddc66fd3c47d10e9 (diff) |
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>
-rw-r--r-- | drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 9092600a1794..2c2e8aca8305 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | |||
@@ -1191,7 +1191,7 @@ static int get_station(struct wiphy *wiphy, struct net_device *dev, | |||
1191 | struct wilc_priv *priv; | 1191 | struct wilc_priv *priv; |
1192 | struct wilc_vif *vif; | 1192 | struct wilc_vif *vif; |
1193 | u32 i = 0; | 1193 | u32 i = 0; |
1194 | u32 associatedsta = 0; | 1194 | u32 associatedsta = ~0; |
1195 | u32 inactive_time = 0; | 1195 | u32 inactive_time = 0; |
1196 | priv = wiphy_priv(wiphy); | 1196 | priv = wiphy_priv(wiphy); |
1197 | vif = netdev_priv(dev); | 1197 | vif = netdev_priv(dev); |
@@ -1204,7 +1204,7 @@ static int get_station(struct wiphy *wiphy, struct net_device *dev, | |||
1204 | } | 1204 | } |
1205 | } | 1205 | } |
1206 | 1206 | ||
1207 | if (associatedsta == -1) { | 1207 | if (associatedsta == ~0) { |
1208 | netdev_err(dev, "sta required is not associated\n"); | 1208 | netdev_err(dev, "sta required is not associated\n"); |
1209 | return -ENOENT; | 1209 | return -ENOENT; |
1210 | } | 1210 | } |