From: Allen Pais <allen.pais@oracle.com>
To: kvalo@codeaurora.org
Cc: davem@davemloft.net, linux-wireless@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] iwlwifi: fix a potential NULL pointer dereference
Date: Wed, 18 Sep 2019 23:41:02 +0530 [thread overview]
Message-ID: <1568830262-5529-1-git-send-email-allen.pais@oracle.com> (raw)
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
next reply other threads:[~2019-09-18 18:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-18 18:11 Allen Pais [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1568830262-5529-1-git-send-email-allen.pais@oracle.com \
--to=allen.pais@oracle.com \
--cc=davem@davemloft.net \
--cc=kvalo@codeaurora.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®