Skip to content

Commit

Permalink
iwlwifi: fix strict_strtoul error checking
Browse files Browse the repository at this point in the history
This patch fixes handling of strcit_strtoul return value
"0 == sucess".

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Emmanuel Grumbach authored and John W. Linville committed Sep 8, 2008
1 parent 6e21f2c commit 926f0b2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/net/wireless/iwlwifi/iwl-agn.c
Original file line number Diff line number Diff line change
Expand Up @@ -3726,7 +3726,7 @@ static ssize_t store_flags(struct device *d,
unsigned long val;
u32 flags;
int ret = strict_strtoul(buf, 0, &val);
if (!ret)
if (ret)
return ret;
flags = (u32)val;

Expand Down Expand Up @@ -3765,7 +3765,7 @@ static ssize_t store_filter_flags(struct device *d,
unsigned long val;
u32 filter_flags;
int ret = strict_strtoul(buf, 0, &val);
if (!ret)
if (ret)
return ret;
filter_flags = (u32)val;

Expand Down Expand Up @@ -3905,7 +3905,7 @@ static ssize_t store_power_level(struct device *d,
}

ret = strict_strtoul(buf, 10, &mode);
if (!ret)
if (ret)
goto out;

ret = iwl_power_set_user_mode(priv, mode);
Expand Down

0 comments on commit 926f0b2

Please sign in to comment.