]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
iwlwifi: fix strict_strtoul error checking
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Wed, 3 Sep 2008 03:26:39 +0000 (11:26 +0800)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 8 Sep 2008 18:23:18 +0000 (14:23 -0400)
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>
drivers/net/wireless/iwlwifi/iwl-agn.c

index b9798fa519ff41b657217e6e5489639eed05739c..ffaf3f2e8a9ebe041588e21b66649a08af6e644f 100644 (file)
@@ -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);