diff options
-rw-r--r-- | include/net/sock.h | 2 | ||||
-rw-r--r-- | net/netfilter/nfnetlink.c | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index 03684e702d13..2c7d60ca3548 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -1278,7 +1278,7 @@ static inline int sock_writeable(const struct sock *sk) | |||
1278 | 1278 | ||
1279 | static inline gfp_t gfp_any(void) | 1279 | static inline gfp_t gfp_any(void) |
1280 | { | 1280 | { |
1281 | return in_softirq() ? GFP_ATOMIC : GFP_KERNEL; | 1281 | return in_atomic() ? GFP_ATOMIC : GFP_KERNEL; |
1282 | } | 1282 | } |
1283 | 1283 | ||
1284 | static inline long sock_rcvtimeo(const struct sock *sk, int noblock) | 1284 | static inline long sock_rcvtimeo(const struct sock *sk, int noblock) |
diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c index 11d504d0ac72..bf23e489e4cd 100644 --- a/net/netfilter/nfnetlink.c +++ b/net/netfilter/nfnetlink.c | |||
@@ -197,13 +197,12 @@ EXPORT_SYMBOL_GPL(nfnetlink_has_listeners); | |||
197 | 197 | ||
198 | int nfnetlink_send(struct sk_buff *skb, u32 pid, unsigned group, int echo) | 198 | int nfnetlink_send(struct sk_buff *skb, u32 pid, unsigned group, int echo) |
199 | { | 199 | { |
200 | gfp_t allocation = in_interrupt() ? GFP_ATOMIC : GFP_KERNEL; | ||
201 | int err = 0; | 200 | int err = 0; |
202 | 201 | ||
203 | NETLINK_CB(skb).dst_group = group; | 202 | NETLINK_CB(skb).dst_group = group; |
204 | if (echo) | 203 | if (echo) |
205 | atomic_inc(&skb->users); | 204 | atomic_inc(&skb->users); |
206 | netlink_broadcast(nfnl, skb, pid, group, allocation); | 205 | netlink_broadcast(nfnl, skb, pid, group, gfp_any()); |
207 | if (echo) | 206 | if (echo) |
208 | err = netlink_unicast(nfnl, skb, pid, MSG_DONTWAIT); | 207 | err = netlink_unicast(nfnl, skb, pid, MSG_DONTWAIT); |
209 | 208 | ||