diff options
| author | Johannes Berg <johannes.berg@intel.com> | 2015-03-03 14:23:47 -0500 |
|---|---|---|
| committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2015-03-12 03:57:49 -0400 |
| commit | e111e9685790ccd9acce5de51fa7ed6b9ae8a746 (patch) | |
| tree | 0d22b971df368538bc221242d2cc8d68c6b7ec9d /drivers/net/wireless/iwlwifi/mvm | |
| parent | 0c2ae049aef7fe1b8800db3f28c23520150bfd78 (diff) | |
iwlwifi: mvm: simplify iwl_mvm_get_wakeup_status() return
The return value in iwl_mvm_get_wakeup_status() is a bit unclear in
that it's not obvious that we don't leak fw_status in some cases.
Use fw_status directly with ERR_PTR() and return only it, that way
the compiler has a chance of proving that it's uninitialized (if it
ever is due to new changes.)
Additionally, this removes a smatch warning since smatch couldn't
figure out that fw_status can't, in fact, leak here.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm')
| -rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/d3.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/d3.c b/drivers/net/wireless/iwlwifi/mvm/d3.c index e3c308435bee..5f8afa5f11a3 100644 --- a/drivers/net/wireless/iwlwifi/mvm/d3.c +++ b/drivers/net/wireless/iwlwifi/mvm/d3.c | |||
| @@ -1599,7 +1599,7 @@ iwl_mvm_get_wakeup_status(struct iwl_mvm *mvm, struct ieee80211_vif *vif) | |||
| 1599 | 1599 | ||
| 1600 | /* RF-kill already asserted again... */ | 1600 | /* RF-kill already asserted again... */ |
| 1601 | if (!cmd.resp_pkt) { | 1601 | if (!cmd.resp_pkt) { |
| 1602 | ret = -ERFKILL; | 1602 | fw_status = ERR_PTR(-ERFKILL); |
| 1603 | goto out_free_resp; | 1603 | goto out_free_resp; |
| 1604 | } | 1604 | } |
| 1605 | 1605 | ||
| @@ -1608,7 +1608,7 @@ iwl_mvm_get_wakeup_status(struct iwl_mvm *mvm, struct ieee80211_vif *vif) | |||
| 1608 | len = iwl_rx_packet_payload_len(cmd.resp_pkt); | 1608 | len = iwl_rx_packet_payload_len(cmd.resp_pkt); |
| 1609 | if (len < status_size) { | 1609 | if (len < status_size) { |
| 1610 | IWL_ERR(mvm, "Invalid WoWLAN status response!\n"); | 1610 | IWL_ERR(mvm, "Invalid WoWLAN status response!\n"); |
| 1611 | ret = -EIO; | 1611 | fw_status = ERR_PTR(-EIO); |
| 1612 | goto out_free_resp; | 1612 | goto out_free_resp; |
| 1613 | } | 1613 | } |
| 1614 | 1614 | ||
| @@ -1616,7 +1616,7 @@ iwl_mvm_get_wakeup_status(struct iwl_mvm *mvm, struct ieee80211_vif *vif) | |||
| 1616 | if (len != (status_size + | 1616 | if (len != (status_size + |
| 1617 | ALIGN(le32_to_cpu(status->wake_packet_bufsize), 4))) { | 1617 | ALIGN(le32_to_cpu(status->wake_packet_bufsize), 4))) { |
| 1618 | IWL_ERR(mvm, "Invalid WoWLAN status response!\n"); | 1618 | IWL_ERR(mvm, "Invalid WoWLAN status response!\n"); |
| 1619 | ret = -EIO; | 1619 | fw_status = ERR_PTR(-EIO); |
| 1620 | goto out_free_resp; | 1620 | goto out_free_resp; |
| 1621 | } | 1621 | } |
| 1622 | 1622 | ||
| @@ -1624,7 +1624,7 @@ iwl_mvm_get_wakeup_status(struct iwl_mvm *mvm, struct ieee80211_vif *vif) | |||
| 1624 | 1624 | ||
| 1625 | out_free_resp: | 1625 | out_free_resp: |
| 1626 | iwl_free_resp(&cmd); | 1626 | iwl_free_resp(&cmd); |
| 1627 | return ret ? ERR_PTR(ret) : fw_status; | 1627 | return fw_status; |
| 1628 | } | 1628 | } |
| 1629 | 1629 | ||
| 1630 | /* releases the MVM mutex */ | 1630 | /* releases the MVM mutex */ |
