[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190311073758.31038-1-kjlu@umn.edu>
Date: Mon, 11 Mar 2019 02:37:57 -0500
From: Kangjie Lu <kjlu@....edu>
To: kjlu@....edu
Cc: pakki001@....edu, Stanislaw Gruszka <sgruszka@...hat.com>,
Kalle Valo <kvalo@...eaurora.org>,
"David S. Miller" <davem@...emloft.net>,
linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] net: iwlegacy: fix potential NULL pointer dereferences
In case create_singlethread_workqueue fails, the fix immediately
return to avoid NULL pointer dereferences.
Signed-off-by: Kangjie Lu <kjlu@....edu>
---
drivers/net/wireless/intel/iwlegacy/3945-mac.c | 2 ++
drivers/net/wireless/intel/iwlegacy/4965-mac.c | 2 ++
2 files changed, 4 insertions(+)
diff --git a/drivers/net/wireless/intel/iwlegacy/3945-mac.c b/drivers/net/wireless/intel/iwlegacy/3945-mac.c
index 271977f7fbb0..d23ee2ca0c8e 100644
--- a/drivers/net/wireless/intel/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/intel/iwlegacy/3945-mac.c
@@ -3403,6 +3403,8 @@ static void
il3945_setup_deferred_work(struct il_priv *il)
{
il->workqueue = create_singlethread_workqueue(DRV_NAME);
+ if (!il->workqueue)
+ return;
init_waitqueue_head(&il->wait_command_queue);
diff --git a/drivers/net/wireless/intel/iwlegacy/4965-mac.c b/drivers/net/wireless/intel/iwlegacy/4965-mac.c
index 94222ae464ae..2c555c9f1ff4 100644
--- a/drivers/net/wireless/intel/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/intel/iwlegacy/4965-mac.c
@@ -6236,6 +6236,8 @@ static void
il4965_setup_deferred_work(struct il_priv *il)
{
il->workqueue = create_singlethread_workqueue(DRV_NAME);
+ if (!il->workqueue)
+ return;
init_waitqueue_head(&il->wait_command_queue);
--
2.17.1
Powered by blists - more mailing lists