aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/crypto_user.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/crypto_user.c')
-rw-r--r--crypto/crypto_user.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/crypto/crypto_user.c b/crypto/crypto_user.c
index 237f3795cfaa..43fe85f20d57 100644
--- a/crypto/crypto_user.c
+++ b/crypto/crypto_user.c
@@ -499,6 +499,7 @@ static int crypto_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
499 if (link->dump == NULL) 499 if (link->dump == NULL)
500 return -EINVAL; 500 return -EINVAL;
501 501
502 down_read(&crypto_alg_sem);
502 list_for_each_entry(alg, &crypto_alg_list, cra_list) 503 list_for_each_entry(alg, &crypto_alg_list, cra_list)
503 dump_alloc += CRYPTO_REPORT_MAXSIZE; 504 dump_alloc += CRYPTO_REPORT_MAXSIZE;
504 505
@@ -508,8 +509,11 @@ static int crypto_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
508 .done = link->done, 509 .done = link->done,
509 .min_dump_alloc = dump_alloc, 510 .min_dump_alloc = dump_alloc,
510 }; 511 };
511 return netlink_dump_start(crypto_nlsk, skb, nlh, &c); 512 err = netlink_dump_start(crypto_nlsk, skb, nlh, &c);
512 } 513 }
514 up_read(&crypto_alg_sem);
515
516 return err;
513 } 517 }
514 518
515 err = nlmsg_parse(nlh, crypto_msg_min[type], attrs, CRYPTOCFGA_MAX, 519 err = nlmsg_parse(nlh, crypto_msg_min[type], attrs, CRYPTOCFGA_MAX,