Skip to contentSkip to conversation

hv_netvsc: Allocate memory in netvsc_dma_map() with GFP_ATOMIC

PATCH Applied Michael Kelley 2 participants 2 messages Feb 6, 2023 – Feb 8, 2023

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hv_netvsc: Allocate memory in netvsc_dma_map() with GFP_ATOMIC

Memory allocations in the network transmit path must use GFP_ATOMIC so they won't sleep.

Fixes 846da38de0e8 ("net: netvsc: Add Isolation VM support for netvsc driver")
---
 drivers/net/hyperv/netvsc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/hyperv/netvsc.c +1 -1
index e02d1e3..79f4e13 100644
@@ -1034,7 +1034,7 @@ static int netvsc_dma_map(struct hv_device *hv_dev,
 
 	packet->dma_range = kcalloc(page_count,
 				    sizeof(*packet->dma_range),
-				    GFP_KERNEL);
+				    GFP_ATOMIC);
 	if (!packet->dma_range)
 		return -ENOMEM;
 
Signature · 1 line
1.8.3.1
#1 lore raw
This patch was applied to netdev/net.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <[email protected]>:

Quoted 10 lines · On Mon, 6 Feb 2023 12:11:57 -0800 you wrote:

Memory allocations in the network transmit path must use GFP_ATOMIC so they won't sleep.

Fixes 846da38de0e8 ("net: netvsc: Add Isolation VM support for netvsc driver")

[...]

Here is the summary with links:
- [net,1/1] hv_netvsc: Allocate memory in netvsc_dma_map() with GFP_ATOMIC

    https://git.kernel.org/netdev/net/c/c6aa9d3b43cd

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html