Browse Source

xfrm: Use GFP_ATOMIC in xfrm_compile_policy

As xfrm_compile_policy runs within a read_lock, we cannot use
GFP_KERNEL for memory allocations.

Reported-by: Luca Tettamanti <kronos.it@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Herbert Xu 14 years ago
parent
commit
2f09a4d5da
1 changed files with 1 additions and 1 deletions
  1. 1 1
      net/xfrm/xfrm_user.c

+ 1 - 1
net/xfrm/xfrm_user.c

@@ -2504,7 +2504,7 @@ static struct xfrm_policy *xfrm_compile_policy(struct sock *sk, int opt,
 	if (p->dir > XFRM_POLICY_OUT)
 	if (p->dir > XFRM_POLICY_OUT)
 		return NULL;
 		return NULL;
 
 
-	xp = xfrm_policy_alloc(net, GFP_KERNEL);
+	xp = xfrm_policy_alloc(net, GFP_ATOMIC);
 	if (xp == NULL) {
 	if (xp == NULL) {
 		*dir = -ENOBUFS;
 		*dir = -ENOBUFS;
 		return NULL;
 		return NULL;