Return-path: Received: from mga01.intel.com ([192.55.52.88]:56324 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754690AbYICDbV (ORCPT ); Tue, 2 Sep 2008 23:31:21 -0400 From: Zhu Yi To: linville@tuxdriver.com Cc: linux-wireless@vger.kernel.org, Emmanuel Grumbach , Tomas Winkler , Zhu Yi Subject: [PATCH 19/39] iwlwifi: fix strict_strtoul error checking Date: Wed, 3 Sep 2008 11:26:39 +0800 Message-Id: <1220412419-15404-20-git-send-email-yi.zhu@intel.com> (sfid-20080903_055044_190822_E4E11BC2) In-Reply-To: <1220412419-15404-19-git-send-email-yi.zhu@intel.com> References: <1220412419-15404-1-git-send-email-yi.zhu@intel.com> <1220412419-15404-2-git-send-email-yi.zhu@intel.com> <1220412419-15404-3-git-send-email-yi.zhu@intel.com> <1220412419-15404-4-git-send-email-yi.zhu@intel.com> <1220412419-15404-5-git-send-email-yi.zhu@intel.com> <1220412419-15404-6-git-send-email-yi.zhu@intel.com> <1220412419-15404-7-git-send-email-yi.zhu@intel.com> <1220412419-15404-8-git-send-email-yi.zhu@intel.com> <1220412419-15404-9-git-send-email-yi.zhu@intel.com> <1220412419-15404-10-git-send-email-yi.zhu@intel.com> <1220412419-15404-11-git-send-email-yi.zhu@intel.com> <1220412419-15404-12-git-send-email-yi.zhu@intel.com> <1220412419-15404-13-git-send-email-yi.zhu@intel.com> <1220412419-15404-14-git-send-email-yi.zhu@intel.com> <1220412419-15404-15-git-send-email-yi.zhu@intel.com> <1220412419-15404-16-git-send-email-yi.zhu@intel.com> <1220412419-15404-17-git-send-email-yi.zhu@intel.com> <1220412419-15404-18-git-send-email-yi.zhu@intel.com> <1220412419-15404-19-git-send-email-yi.zhu@intel.com> Sender: linux-wireless-owner@vger.kernel.org List-ID: From: Emmanuel Grumbach 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 --- 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