sparc: Use GFP_ATOMIC in ldc_alloc_exp_dring() as it can be called in softirq context

Since it is possible for vnet_event_napi to end up doing
vnet_control_pkt_engine -> ... -> vnet_send_attr ->
vnet_port_alloc_tx_ring -> ldc_alloc_exp_dring -> kzalloc()
(i.e., in softirq context), kzalloc() should be called with
GFP_ATOMIC from ldc_alloc_exp_dring.

Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Sowmini Varadhan 2015-04-21 10:30:41 -04:00 committed by David S. Miller
parent df386375ff
commit 0edfad5959

View File

@ -2290,7 +2290,7 @@ void *ldc_alloc_exp_dring(struct ldc_channel *lp, unsigned int len,
if (len & (8UL - 1)) if (len & (8UL - 1))
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
buf = kzalloc(len, GFP_KERNEL); buf = kzalloc(len, GFP_ATOMIC);
if (!buf) if (!buf)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);