diff options
author | Johannes Berg <johannes.berg@intel.com> | 2018-06-18 10:53:36 +0300 |
---|---|---|
committer | Luca Coelho <luciano.coelho@intel.com> | 2018-10-06 10:25:51 +0300 |
commit | 6e00a2376fb7d9974fa8ef791aabdca5314b91d3 (patch) | |
tree | 0f04f52b072c3bf38f040dbff78f5c2b60d7361a /drivers/net | |
parent | e00b7b8b91856215743f4e65ac199b41c2e2a3cb (diff) | |
download | linux-6e00a2376fb7d9974fa8ef791aabdca5314b91d3.tar.xz |
iwlwifi: pcie: check iwl_pcie_txq_build_tfd() return value
If we use the iwl_pcie_txq_build_tfd() return value for BIT(),
we should validate that it's not going to be negative, so do
the check and bail out if we hit an error. We shouldn't, as
we check if it'll fit beforehand, but better be safe.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/pcie/tx.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/tx.c b/drivers/net/wireless/intel/iwlwifi/pcie/tx.c index 67820bfaba64..f227b91098c9 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/tx.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/tx.c @@ -2013,6 +2013,8 @@ static int iwl_fill_data_tbs(struct iwl_trans *trans, struct sk_buff *skb, return -EINVAL; tb_idx = iwl_pcie_txq_build_tfd(trans, txq, tb_phys, skb_frag_size(frag), false); + if (tb_idx < 0) + return tb_idx; out_meta->tbs |= BIT(tb_idx); } |