stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH for 4.4.y] iwlwifi: pcie: fix to correct null check
@ 2021-03-03  7:57 Nobuhiro Iwamatsu
  2021-03-04 13:29 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Nobuhiro Iwamatsu @ 2021-03-03  7:57 UTC (permalink / raw)
  To: stable
  Cc: gregkh, sashal, Nobuhiro Iwamatsu, Emmanuel Grumbach,
	Luca Coelho, Kalle Valo

The fixes made in commit: 4ae5798004d8 ("iwlwifi: pcie: add a NULL check in
iwl_pcie_txq_unmap") is not enough in 4.4.y tree.. This still have problems
with null references. This provides the correct fix.
Also, this is a problem only in 4.4.y. This patch has been applied to other
LTS trees, but with the correct fixes.

Fixes: 4ae5798004d8 ("iwlwifi: pcie: add a NULL check in iwl_pcie_txq_unmap")
Cc: stable@vger.kernel.org
Cc: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Cc: Luca Coelho <luciano.coelho@intel.com>
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: Sasha Levin <sashal@kernel.org>
Signed-off-by: Nobuhiro Iwamatsu (CIP) <nobuhiro1.iwamatsu@toshiba.co.jp>
---
 drivers/net/wireless/iwlwifi/pcie/tx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/iwlwifi/pcie/tx.c b/drivers/net/wireless/iwlwifi/pcie/tx.c
index cb03c2855019..7584796131fa 100644
--- a/drivers/net/wireless/iwlwifi/pcie/tx.c
+++ b/drivers/net/wireless/iwlwifi/pcie/tx.c
@@ -583,13 +583,15 @@ static void iwl_pcie_txq_unmap(struct iwl_trans *trans, int txq_id)
 {
 	struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
 	struct iwl_txq *txq = &trans_pcie->txq[txq_id];
-	struct iwl_queue *q = &txq->q;
+	struct iwl_queue *q;
 
 	if (!txq) {
 		IWL_ERR(trans, "Trying to free a queue that wasn't allocated?\n");
 		return;
 	}
 
+	q = &txq->q;
+
 	spin_lock_bh(&txq->lock);
 	while (q->write_ptr != q->read_ptr) {
 		IWL_DEBUG_TX_REPLY(trans, "Q %d Free %d\n",
-- 
2.30.0.rc2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH for 4.4.y] iwlwifi: pcie: fix to correct null check
  2021-03-03  7:57 [PATCH for 4.4.y] iwlwifi: pcie: fix to correct null check Nobuhiro Iwamatsu
@ 2021-03-04 13:29 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2021-03-04 13:29 UTC (permalink / raw)
  To: Nobuhiro Iwamatsu
  Cc: stable, sashal, Emmanuel Grumbach, Luca Coelho, Kalle Valo

On Wed, Mar 03, 2021 at 04:57:31PM +0900, Nobuhiro Iwamatsu wrote:
> The fixes made in commit: 4ae5798004d8 ("iwlwifi: pcie: add a NULL check in
> iwl_pcie_txq_unmap") is not enough in 4.4.y tree.. This still have problems
> with null references. This provides the correct fix.
> Also, this is a problem only in 4.4.y. This patch has been applied to other
> LTS trees, but with the correct fixes.
> 
> Fixes: 4ae5798004d8 ("iwlwifi: pcie: add a NULL check in iwl_pcie_txq_unmap")
> Cc: stable@vger.kernel.org
> Cc: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
> Cc: Luca Coelho <luciano.coelho@intel.com>
> Cc: Kalle Valo <kvalo@codeaurora.org>
> Cc: Sasha Levin <sashal@kernel.org>
> Signed-off-by: Nobuhiro Iwamatsu (CIP) <nobuhiro1.iwamatsu@toshiba.co.jp>
> ---
>  drivers/net/wireless/iwlwifi/pcie/tx.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Thanks for the fix, now queued up.

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-04 13:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-03  7:57 [PATCH for 4.4.y] iwlwifi: pcie: fix to correct null check Nobuhiro Iwamatsu
2021-03-04 13:29 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).