From: Emmanuel Grumbach Date: Wed, 3 Sep 2008 03:26:39 +0000 (+0800) Subject: iwlwifi: fix strict_strtoul error checking X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=926f0b2ef24041db876ec7213fbddd7cd4555951;p=openwrt%2Fstaging%2Fblogic.git iwlwifi: fix strict_strtoul error checking This patch fixes handling of strcit_strtoul return value "0 == sucess". Signed-off-by: Emmanuel Grumbach Signed-off-by: Tomas Winkler Signed-off-by: Zhu Yi Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index b9798fa519ff..ffaf3f2e8a9e 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c @@ -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; @@ -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; @@ -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);