* [PATCH] staging: wilc1000: Avoid GFP_KERNEL allocation from atomic context.
@ 2019-04-07 12:58 Tetsuo Handa
2019-04-08 21:13 ` Adham.Abozaeid
2019-04-16 11:15 ` Greg Kroah-Hartman
0 siblings, 2 replies; 4+ messages in thread
From: Tetsuo Handa @ 2019-04-07 12:58 UTC (permalink / raw)
To: Adham Abozaeid, Ajay Singh, Greg Kroah-Hartman
Cc: linux-wireless, Tetsuo Handa
Since wilc_set_multicast_list() is called with dev->addr_list_lock
spinlock held, we can't use GFP_KERNEL memory allocation.
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Fixes: e624c58cf8eb5116 ("staging: wilc1000: refactor code to avoid use of wilc_set_multicast_list global")
Cc: Ajay Singh <ajay.kathat@microchip.com>
---
drivers/staging/wilc1000/wilc_netdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/wilc1000/wilc_netdev.c b/drivers/staging/wilc1000/wilc_netdev.c
index 1787154..ba78c08 100644
--- a/drivers/staging/wilc1000/wilc_netdev.c
+++ b/drivers/staging/wilc1000/wilc_netdev.c
@@ -708,7 +708,7 @@ static void wilc_set_multicast_list(struct net_device *dev)
return;
}
- mc_list = kmalloc_array(dev->mc.count, ETH_ALEN, GFP_KERNEL);
+ mc_list = kmalloc_array(dev->mc.count, ETH_ALEN, GFP_ATOMIC);
if (!mc_list)
return;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] staging: wilc1000: Avoid GFP_KERNEL allocation from atomic context.
2019-04-07 12:58 [PATCH] staging: wilc1000: Avoid GFP_KERNEL allocation from atomic context Tetsuo Handa
@ 2019-04-08 21:13 ` Adham.Abozaeid
2019-04-16 11:15 ` Greg Kroah-Hartman
1 sibling, 0 replies; 4+ messages in thread
From: Adham.Abozaeid @ 2019-04-08 21:13 UTC (permalink / raw)
To: penguin-kernel, Ajay.Kathat, gregkh; +Cc: linux-wireless
On 4/7/19 5:58 AM, Tetsuo Handa wrote:
> Since wilc_set_multicast_list() is called with dev->addr_list_lock
> spinlock held, we can't use GFP_KERNEL memory allocation.
>
> Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> Fixes: e624c58cf8eb5116 ("staging: wilc1000: refactor code to avoid use of wilc_set_multicast_list global")
> Cc: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Adham Abozaeid <adham.abozaeid@microchip.com>
Thanks,
Adham
> ---
> drivers/staging/wilc1000/wilc_netdev.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/wilc1000/wilc_netdev.c b/drivers/staging/wilc1000/wilc_netdev.c
> index 1787154..ba78c08 100644
> --- a/drivers/staging/wilc1000/wilc_netdev.c
> +++ b/drivers/staging/wilc1000/wilc_netdev.c
> @@ -708,7 +708,7 @@ static void wilc_set_multicast_list(struct net_device *dev)
> return;
> }
>
> - mc_list = kmalloc_array(dev->mc.count, ETH_ALEN, GFP_KERNEL);
> + mc_list = kmalloc_array(dev->mc.count, ETH_ALEN, GFP_ATOMIC);
> if (!mc_list)
> return;
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] staging: wilc1000: Avoid GFP_KERNEL allocation from atomic context.
2019-04-07 12:58 [PATCH] staging: wilc1000: Avoid GFP_KERNEL allocation from atomic context Tetsuo Handa
2019-04-08 21:13 ` Adham.Abozaeid
@ 2019-04-16 11:15 ` Greg Kroah-Hartman
1 sibling, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2019-04-16 11:15 UTC (permalink / raw)
To: Tetsuo Handa; +Cc: Adham Abozaeid, Ajay Singh, linux-wireless
On Sun, Apr 07, 2019 at 09:58:43PM +0900, Tetsuo Handa wrote:
> Since wilc_set_multicast_list() is called with dev->addr_list_lock
> spinlock held, we can't use GFP_KERNEL memory allocation.
>
> Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> Fixes: e624c58cf8eb5116 ("staging: wilc1000: refactor code to avoid use of wilc_set_multicast_list global")
No need for so many sha1 characters, this is the canonical length to
use:
e624c58cf8eb
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] staging: wilc1000: Avoid GFP_KERNEL allocation from atomic context
@ 2019-04-16 23:17 Adham.Abozaeid
0 siblings, 0 replies; 4+ messages in thread
From: Adham.Abozaeid @ 2019-04-16 23:17 UTC (permalink / raw)
To: linux-wireless; +Cc: devel, gregkh, johannes, Ajay.Kathat, Adham.Abozaeid
From: Adham Abozaeid <adham.abozaeid@microchip.com>
txq_add_mgmt_pkt allocates memory while being called from atomic context
so needs to use GFP_ATOMIC
Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com>
---
drivers/staging/wilc1000/wilc_wlan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 2b309c8a8fb2..0a713409ea98 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -316,7 +316,7 @@ int wilc_wlan_txq_add_mgmt_pkt(struct net_device *dev, void *priv, u8 *buffer,
if (wilc->quit)
return 0;
- tqe = kmalloc(sizeof(*tqe), GFP_KERNEL);
+ tqe = kmalloc(sizeof(*tqe), GFP_ATOMIC);
if (!tqe)
return 0;
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-04-16 23:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-07 12:58 [PATCH] staging: wilc1000: Avoid GFP_KERNEL allocation from atomic context Tetsuo Handa
2019-04-08 21:13 ` Adham.Abozaeid
2019-04-16 11:15 ` Greg Kroah-Hartman
-- strict thread matches above, loose matches on Subject: below --
2019-04-16 23:17 Adham.Abozaeid
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).