diff options
author | Johannes Berg <johannes.berg@intel.com> | 2014-09-09 15:16:06 -0400 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2014-09-14 05:56:39 -0400 |
commit | 5d4185ae0c68eeff26d0390a4e99b6e7359a8b83 (patch) | |
tree | efca655d686da4f1df5bff67eac467fff2daf542 /drivers/net/wireless/iwlwifi/pcie | |
parent | c2a2b28bb7fbcb8e0e11b84714992750bba7b699 (diff) |
iwlwifi: pcie: clear command data on freeing
When freeing the structures used for command data, clear their
memory as they may have contained key material at some point.
Also clear the duplicated buffer when freeing it to be safe;
currently key material is never put there but that may change.
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/pcie')
-rw-r--r-- | drivers/net/wireless/iwlwifi/pcie/rx.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/pcie/tx.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/wireless/iwlwifi/pcie/rx.c b/drivers/net/wireless/iwlwifi/pcie/rx.c index 702f47fb16fe..7b7e2f223fb2 100644 --- a/drivers/net/wireless/iwlwifi/pcie/rx.c +++ b/drivers/net/wireless/iwlwifi/pcie/rx.c | |||
@@ -640,7 +640,7 @@ static void iwl_pcie_rx_handle_rb(struct iwl_trans *trans, | |||
640 | err = iwl_op_mode_rx(trans->op_mode, &rxcb, cmd); | 640 | err = iwl_op_mode_rx(trans->op_mode, &rxcb, cmd); |
641 | 641 | ||
642 | if (reclaim) { | 642 | if (reclaim) { |
643 | kfree(txq->entries[cmd_index].free_buf); | 643 | kzfree(txq->entries[cmd_index].free_buf); |
644 | txq->entries[cmd_index].free_buf = NULL; | 644 | txq->entries[cmd_index].free_buf = NULL; |
645 | } | 645 | } |
646 | 646 | ||
diff --git a/drivers/net/wireless/iwlwifi/pcie/tx.c b/drivers/net/wireless/iwlwifi/pcie/tx.c index 35fe38e52d2e..eb8e2984c5e9 100644 --- a/drivers/net/wireless/iwlwifi/pcie/tx.c +++ b/drivers/net/wireless/iwlwifi/pcie/tx.c | |||
@@ -620,8 +620,8 @@ static void iwl_pcie_txq_free(struct iwl_trans *trans, int txq_id) | |||
620 | /* De-alloc array of command/tx buffers */ | 620 | /* De-alloc array of command/tx buffers */ |
621 | if (txq_id == trans_pcie->cmd_queue) | 621 | if (txq_id == trans_pcie->cmd_queue) |
622 | for (i = 0; i < txq->q.n_window; i++) { | 622 | for (i = 0; i < txq->q.n_window; i++) { |
623 | kfree(txq->entries[i].cmd); | 623 | kzfree(txq->entries[i].cmd); |
624 | kfree(txq->entries[i].free_buf); | 624 | kzfree(txq->entries[i].free_buf); |
625 | } | 625 | } |
626 | 626 | ||
627 | /* De-alloc circular buffer of TFDs */ | 627 | /* De-alloc circular buffer of TFDs */ |
@@ -1409,7 +1409,7 @@ static int iwl_pcie_enqueue_hcmd(struct iwl_trans *trans, | |||
1409 | 1409 | ||
1410 | out_meta->flags = cmd->flags; | 1410 | out_meta->flags = cmd->flags; |
1411 | if (WARN_ON_ONCE(txq->entries[idx].free_buf)) | 1411 | if (WARN_ON_ONCE(txq->entries[idx].free_buf)) |
1412 | kfree(txq->entries[idx].free_buf); | 1412 | kzfree(txq->entries[idx].free_buf); |
1413 | txq->entries[idx].free_buf = dup_buf; | 1413 | txq->entries[idx].free_buf = dup_buf; |
1414 | 1414 | ||
1415 | trace_iwlwifi_dev_hcmd(trans->dev, cmd, cmd_size, &out_cmd->hdr); | 1415 | trace_iwlwifi_dev_hcmd(trans->dev, cmd, cmd_size, &out_cmd->hdr); |