diff options
author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2010-01-15 16:43:36 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-01-19 16:25:10 -0500 |
commit | 937c397eb633b804d9a806d08c395ecfc42b1fec (patch) | |
tree | a9a24507cd22b1bb7e77eb2840e66cc9ad88ae0d | |
parent | 11fc524941248dc717f1af5dfa844eceb7c0217f (diff) |
iwlwifi: correct return code for log_event
When dumping event log in debugfs, iwl_dump_nic_event_log()
should return the correct error code instead of let the calling
function makes it own assumption.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-debugfs.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 4 |
3 files changed, 7 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index c78063312ea9..eaa309d8bee1 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -1965,7 +1965,7 @@ int iwl_dump_nic_event_log(struct iwl_priv *priv, bool full_log, | |||
1965 | IWL_ERR(priv, | 1965 | IWL_ERR(priv, |
1966 | "Invalid event log pointer 0x%08X for %s uCode\n", | 1966 | "Invalid event log pointer 0x%08X for %s uCode\n", |
1967 | base, (priv->ucode_type == UCODE_INIT) ? "Init" : "RT"); | 1967 | base, (priv->ucode_type == UCODE_INIT) ? "Init" : "RT"); |
1968 | return pos; | 1968 | return -EINVAL; |
1969 | } | 1969 | } |
1970 | 1970 | ||
1971 | /* event log header */ | 1971 | /* event log header */ |
@@ -2013,7 +2013,7 @@ int iwl_dump_nic_event_log(struct iwl_priv *priv, bool full_log, | |||
2013 | bufsz = size * 48; | 2013 | bufsz = size * 48; |
2014 | *buf = kmalloc(bufsz, GFP_KERNEL); | 2014 | *buf = kmalloc(bufsz, GFP_KERNEL); |
2015 | if (!*buf) | 2015 | if (!*buf) |
2016 | return pos; | 2016 | return -ENOMEM; |
2017 | } | 2017 | } |
2018 | if ((iwl_get_debug_level(priv) & IWL_DL_FW_ERRORS) || full_log) { | 2018 | if ((iwl_get_debug_level(priv) & IWL_DL_FW_ERRORS) || full_log) { |
2019 | /* | 2019 | /* |
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c index 19c7fab47939..a7ca06d21d59 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c +++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c | |||
@@ -429,8 +429,9 @@ static ssize_t iwl_dbgfs_log_event_read(struct file *file, | |||
429 | int pos = 0; | 429 | int pos = 0; |
430 | ssize_t ret = -ENOMEM; | 430 | ssize_t ret = -ENOMEM; |
431 | 431 | ||
432 | pos = priv->cfg->ops->lib->dump_nic_event_log(priv, true, &buf, true); | 432 | ret = pos = priv->cfg->ops->lib->dump_nic_event_log( |
433 | if (pos && buf) { | 433 | priv, true, &buf, true); |
434 | if (buf) { | ||
434 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); | 435 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); |
435 | kfree(buf); | 436 | kfree(buf); |
436 | } | 437 | } |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 10b0aa8024c4..8bbcc5487aa0 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -1644,7 +1644,7 @@ int iwl3945_dump_nic_event_log(struct iwl_priv *priv, bool full_log, | |||
1644 | base = le32_to_cpu(priv->card_alive.log_event_table_ptr); | 1644 | base = le32_to_cpu(priv->card_alive.log_event_table_ptr); |
1645 | if (!iwl3945_hw_valid_rtc_data_addr(base)) { | 1645 | if (!iwl3945_hw_valid_rtc_data_addr(base)) { |
1646 | IWL_ERR(priv, "Invalid event log pointer 0x%08X\n", base); | 1646 | IWL_ERR(priv, "Invalid event log pointer 0x%08X\n", base); |
1647 | return pos; | 1647 | return -EINVAL; |
1648 | } | 1648 | } |
1649 | 1649 | ||
1650 | /* event log header */ | 1650 | /* event log header */ |
@@ -1693,7 +1693,7 @@ int iwl3945_dump_nic_event_log(struct iwl_priv *priv, bool full_log, | |||
1693 | bufsz = size * 48; | 1693 | bufsz = size * 48; |
1694 | *buf = kmalloc(bufsz, GFP_KERNEL); | 1694 | *buf = kmalloc(bufsz, GFP_KERNEL); |
1695 | if (!*buf) | 1695 | if (!*buf) |
1696 | return pos; | 1696 | return -ENOMEM; |
1697 | } | 1697 | } |
1698 | if ((iwl_get_debug_level(priv) & IWL_DL_FW_ERRORS) || full_log) { | 1698 | if ((iwl_get_debug_level(priv) & IWL_DL_FW_ERRORS) || full_log) { |
1699 | /* if uCode has wrapped back to top of log, | 1699 | /* if uCode has wrapped back to top of log, |