summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJia-Ju Bai <baijiaju1990@gmail.com>2018-01-25 05:06:02 -0500
committerHerbert Xu <herbert@gondor.apana.org.au>2018-02-15 10:26:47 -0500
commit9a69b7ae79d886e27db5164af91fbd75a0e0e89d (patch)
treec6c1df0d615b24ecdd75099cb43b130697698220
parent1ca2809897155f1adc43e4859b4a3582e235c09a (diff)
crypto: user - Replace GFP_ATOMIC with GFP_KERNEL in crypto_report
After checking all possible call chains to crypto_report here, my tool finds that crypto_report is never called in atomic context. And crypto_report calls crypto_alg_match which calls down_read, thus it proves again that crypto_report can call functions which may sleep. Thus GFP_ATOMIC is not necessary, and it can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--crypto/crypto_user.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/crypto_user.c b/crypto/crypto_user.c
index 5c291eedaa70..0e89b5457cab 100644
--- a/crypto/crypto_user.c
+++ b/crypto/crypto_user.c
@@ -271,7 +271,7 @@ static int crypto_report(struct sk_buff *in_skb, struct nlmsghdr *in_nlh,
271 return -ENOENT; 271 return -ENOENT;
272 272
273 err = -ENOMEM; 273 err = -ENOMEM;
274 skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); 274 skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
275 if (!skb) 275 if (!skb)
276 goto drop_alg; 276 goto drop_alg;
277 277