diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2021-02-10 13:56:35 +0200 |
---|---|---|
committer | Luca Coelho <luciano.coelho@intel.com> | 2021-02-10 14:37:30 +0200 |
commit | 9cf671d60fdbeb8f875859c11148cf13c326ada2 (patch) | |
tree | 383c4ac34aea903a6e1a95f23e1717c4dee11bb6 /drivers/net/wireless/intel/iwlwifi/pcie/rx.c | |
parent | 28db1862067cb09ebfdccfbc129a52c6fdb4c4d7 (diff) | |
download | linux-9cf671d60fdbeb8f875859c11148cf13c326ada2.tar.bz2 |
iwlwifi: pcie: NULLify pointers after free
Remember that those pointers have been freed by setting them
to NULL. Otherwise, we'd keep rxq pointing to random memory
which would prevent us from trying to re-allocate the Rx
resources if we call rx_alloc again.
Also, propagate the allocation failure to the caller of
iwl_pcie_nic_init so that we won't go further in the
start flow.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210210135352.996b400d2f1c.I630379c504644700322f57b259383ae0af8d1975@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/pcie/rx.c')
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/pcie/rx.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/rx.c b/drivers/net/wireless/intel/iwlwifi/pcie/rx.c index 407809c7e958..664481ca58c9 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/rx.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/rx.c @@ -834,8 +834,11 @@ err: trans_pcie->base_rb_stts_dma = 0; } kfree(trans_pcie->rx_pool); + trans_pcie->rx_pool = NULL; kfree(trans_pcie->global_table); + trans_pcie->global_table = NULL; kfree(trans_pcie->rxq); + trans_pcie->rxq = NULL; return ret; } |