summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorOr Gerlitz <ogerlitz@mellanox.com>2014-01-29 17:08:59 +0100
committerDavid S. Miller <davem@davemloft.net>2014-01-31 01:25:48 +0100
commitb5aaab12b2b4bc4acab7384c17a87f3406e5047d (patch)
treec07e22943f2c0a05c3cde04f162b9b32cf95200f /net
parentnet: eth: cpsw: Correctly attach to GPIO bitbang MDIO driver (diff)
downloadlinux-b5aaab12b2b4bc4acab7384c17a87f3406e5047d.tar.xz
linux-b5aaab12b2b4bc4acab7384c17a87f3406e5047d.zip
net/ipv4: Use non-atomic allocation of udp offloads structure instance
Since udp_add_offload() can be called from non-sleepable context e.g under this call tree from the vxlan driver use case: vxlan_socket_create() <-- holds the spinlock -> vxlan_notify_add_rx_port() -> udp_add_offload() <-- schedules we should allocate the udp_offloads structure in atomic manner. Fixes: b582ef0 ('net: Add GRO support for UDP encapsulating protocols') Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/udp_offload.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c
index 25f5cee3a08a..2ffea6f31efc 100644
--- a/net/ipv4/udp_offload.c
+++ b/net/ipv4/udp_offload.c
@@ -101,7 +101,7 @@ out:
int udp_add_offload(struct udp_offload *uo)
{
struct udp_offload_priv __rcu **head = &udp_offload_base;
- struct udp_offload_priv *new_offload = kzalloc(sizeof(*new_offload), GFP_KERNEL);
+ struct udp_offload_priv *new_offload = kzalloc(sizeof(*new_offload), GFP_ATOMIC);
if (!new_offload)
return -ENOMEM;