Search Linux Wireless

[PATCH 19/39] iwlwifi: fix strict_strtoul error checking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Emmanuel Grumbach <emmanuel.grumbach@xxxxxxxxx>

This patch fixes handling of strcit_strtoul return value
"0 == sucess".

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@xxxxxxxxx>
Signed-off-by: Tomas Winkler <tomas.winkler@xxxxxxxxx>
Signed-off-by: Zhu Yi <yi.zhu@xxxxxxxxx>
---
 drivers/net/wireless/iwlwifi/iwl-agn.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 2330ed1..f3c96ad 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -3728,7 +3728,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;
 
@@ -3767,7 +3767,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;
 
@@ -3907,7 +3907,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);
-- 
1.5.3.6

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux