linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iwlwifi: fix a potential NULL pointer dereference
@ 2019-09-18 18:11 Allen Pais
  2019-09-18 20:19 ` kbuild test robot
  2019-09-19  7:08 ` Johannes Berg
  0 siblings, 2 replies; 6+ messages in thread
From: Allen Pais @ 2019-09-18 18:11 UTC (permalink / raw)
  To: kvalo; +Cc: davem, linux-wireless, linux-kernel

alloc_workqueue is not checked for errors and as a result,
a potential NULL dereference could occur.

Signed-off-by: Allen Pais <allen.pais@oracle.com>
---
 drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
index db62c83..276c26b 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
@@ -3655,6 +3655,11 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev,
 
 	trans_pcie->rba.alloc_wq = alloc_workqueue("rb_allocator",
 						   WQ_HIGHPRI | WQ_UNBOUND, 1);
+	if (unlikely(!trans_pcie->rba.alloc_wq)) {
+		return -ENOMEM;
+		goto out_free_ict;
+	}
+
 	INIT_WORK(&trans_pcie->rba.rx_alloc, iwl_pcie_rx_allocator_work);
 
 #ifdef CONFIG_IWLWIFI_PCIE_RTPM
-- 
1.9.1


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

end of thread, other threads:[~2019-09-19 15:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-18 18:11 [PATCH] iwlwifi: fix a potential NULL pointer dereference Allen Pais
2019-09-18 20:19 ` kbuild test robot
2019-09-19  7:08 ` Johannes Berg
2019-09-19 14:07   ` Allen
2019-09-19 14:47     ` Johannes Berg
2019-09-19 15:29       ` Allen

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).