Skip to content

Commit

Permalink
hv_netvsc: Allocate memory in netvsc_dma_map() with GFP_ATOMIC
Browse files Browse the repository at this point in the history
Memory allocations in the network transmit path must use GFP_ATOMIC
so they won't sleep.

Reported-by: Paolo Abeni <pabeni@redhat.com>
Link: https://lore.kernel.org/lkml/8a4d08f94d3e6fe8b6da68440eaa89a088ad84f9.camel@redhat.com/
Fixes: 846da38 ("net: netvsc: Add Isolation VM support for netvsc driver")
Cc: stable@vger.kernel.org
Signed-off-by: Michael Kelley <mikelley@microsoft.com>
Link: https://lore.kernel.org/r/1675714317-48577-1-git-send-email-mikelley@microsoft.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Michael Kelley authored and Jakub Kicinski committed Feb 8, 2023
1 parent 565b482 commit c6aa9d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/hyperv/netvsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit c6aa9d3

Please sign in to comment.