linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: rtlwifi: fix a potential NULL pointer dereference
@ 2019-03-12  7:56 Kangjie Lu
  2019-03-23  3:59 ` Kangjie Lu
  2019-04-04 10:25 ` [PATCH] " Kalle Valo
  0 siblings, 2 replies; 4+ messages in thread
From: Kangjie Lu @ 2019-03-12  7:56 UTC (permalink / raw)
  To: kjlu
  Cc: pakki001, Ping-Ke Shih, Kalle Valo, David S. Miller,
	linux-wireless, netdev, linux-kernel

In case alloc_workqueue fails, the fix reports the error and
returns to avoid NULL pointer dereference.

Signed-off-by: Kangjie Lu <kjlu@umn.edu>
---
 drivers/net/wireless/realtek/rtlwifi/base.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtlwifi/base.c b/drivers/net/wireless/realtek/rtlwifi/base.c
index 217d2a7a43c7..ac746c322554 100644
--- a/drivers/net/wireless/realtek/rtlwifi/base.c
+++ b/drivers/net/wireless/realtek/rtlwifi/base.c
@@ -448,6 +448,11 @@ static void _rtl_init_deferred_work(struct ieee80211_hw *hw)
 	/* <2> work queue */
 	rtlpriv->works.hw = hw;
 	rtlpriv->works.rtl_wq = alloc_workqueue("%s", 0, 0, rtlpriv->cfg->name);
+	if (unlikely(!rtlpriv->works.rtl_wq)) {
+		pr_err("Failed to allocate work queue\n");
+		return;
+	}
+
 	INIT_DELAYED_WORK(&rtlpriv->works.watchdog_wq,
 			  (void *)rtl_watchdog_wq_callback);
 	INIT_DELAYED_WORK(&rtlpriv->works.ips_nic_off_wq,
-- 
2.17.1


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

* Re: [PATCH] net: rtlwifi: fix a potential NULL pointer dereference
  2019-03-12  7:56 [PATCH] net: rtlwifi: fix a potential NULL pointer dereference Kangjie Lu
@ 2019-03-23  3:59 ` Kangjie Lu
  2019-03-23  6:40   ` Kalle Valo
  2019-04-04 10:25 ` [PATCH] " Kalle Valo
  1 sibling, 1 reply; 4+ messages in thread
From: Kangjie Lu @ 2019-03-23  3:59 UTC (permalink / raw)
  To: kjlu
  Cc: pakki001, Ping-Ke Shih, Kalle Valo, David S. Miller,
	linux-wireless, netdev, linux-kernel



> On Mar 12, 2019, at 2:56 AM, Kangjie Lu <kjlu@umn.edu> wrote:
> 
> In case alloc_workqueue fails, the fix reports the error and
> returns to avoid NULL pointer dereference.
> 
> Signed-off-by: Kangjie Lu <kjlu@umn.edu>
> ---
> drivers/net/wireless/realtek/rtlwifi/base.c | 5 +++++
> 1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/net/wireless/realtek/rtlwifi/base.c b/drivers/net/wireless/realtek/rtlwifi/base.c
> index 217d2a7a43c7..ac746c322554 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/base.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/base.c
> @@ -448,6 +448,11 @@ static void _rtl_init_deferred_work(struct ieee80211_hw *hw)
> 	/* <2> work queue */
> 	rtlpriv->works.hw = hw;
> 	rtlpriv->works.rtl_wq = alloc_workqueue("%s", 0, 0, rtlpriv->cfg->name);
> +	if (unlikely(!rtlpriv->works.rtl_wq)) {
> +		pr_err("Failed to allocate work queue\n");
> +		return;
> +	}
> +

Can someone review the patch?

Thanks.

> 	INIT_DELAYED_WORK(&rtlpriv->works.watchdog_wq,
> 			  (void *)rtl_watchdog_wq_callback);
> 	INIT_DELAYED_WORK(&rtlpriv->works.ips_nic_off_wq,
> -- 
> 2.17.1
> 


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

* Re: [PATCH] net: rtlwifi: fix a potential NULL pointer dereference
  2019-03-23  3:59 ` Kangjie Lu
@ 2019-03-23  6:40   ` Kalle Valo
  0 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2019-03-23  6:40 UTC (permalink / raw)
  To: Kangjie Lu
  Cc: pakki001, Ping-Ke Shih, David S. Miller, linux-wireless, netdev,
	linux-kernel

Kangjie Lu <kjlu@umn.edu> writes:

>> On Mar 12, 2019, at 2:56 AM, Kangjie Lu <kjlu@umn.edu> wrote:
>> 
>> In case alloc_workqueue fails, the fix reports the error and
>> returns to avoid NULL pointer dereference.
>> 
>> Signed-off-by: Kangjie Lu <kjlu@umn.edu>
>> ---
>> drivers/net/wireless/realtek/rtlwifi/base.c | 5 +++++
>> 1 file changed, 5 insertions(+)
>> 
>> diff --git a/drivers/net/wireless/realtek/rtlwifi/base.c
>> b/drivers/net/wireless/realtek/rtlwifi/base.c
>> index 217d2a7a43c7..ac746c322554 100644
>> --- a/drivers/net/wireless/realtek/rtlwifi/base.c
>> +++ b/drivers/net/wireless/realtek/rtlwifi/base.c
>> @@ -448,6 +448,11 @@ static void _rtl_init_deferred_work(struct ieee80211_hw *hw)
>> 	/* <2> work queue */
>> 	rtlpriv->works.hw = hw;
>> 	rtlpriv->works.rtl_wq = alloc_workqueue("%s", 0, 0, rtlpriv->cfg->name);
>> +	if (unlikely(!rtlpriv->works.rtl_wq)) {
>> +		pr_err("Failed to allocate work queue\n");
>> +		return;
>> +	}
>> +
>
> Can someone review the patch?

wireless-drivers-next is not yet open due to the wireless workshop. Also
you can check the patch status yourself:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches#checking_state_of_patches_from_patchwork

-- 
Kalle Valo

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

* Re: [PATCH] rtlwifi: fix a potential NULL pointer dereference
  2019-03-12  7:56 [PATCH] net: rtlwifi: fix a potential NULL pointer dereference Kangjie Lu
  2019-03-23  3:59 ` Kangjie Lu
@ 2019-04-04 10:25 ` Kalle Valo
  1 sibling, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2019-04-04 10:25 UTC (permalink / raw)
  To: Kangjie Lu
  Cc: kjlu, pakki001, Ping-Ke Shih, David S. Miller, linux-wireless,
	netdev, linux-kernel

Kangjie Lu <kjlu@umn.edu> wrote:

> In case alloc_workqueue fails, the fix reports the error and
> returns to avoid NULL pointer dereference.
> 
> Signed-off-by: Kangjie Lu <kjlu@umn.edu>

Patch applied to wireless-drivers-next.git, thanks.

765976285a8c rtlwifi: fix a potential NULL pointer dereference

-- 
https://patchwork.kernel.org/patch/10848697/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


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

end of thread, other threads:[~2019-04-04 10:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-12  7:56 [PATCH] net: rtlwifi: fix a potential NULL pointer dereference Kangjie Lu
2019-03-23  3:59 ` Kangjie Lu
2019-03-23  6:40   ` Kalle Valo
2019-04-04 10:25 ` [PATCH] " Kalle Valo

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