summaryrefslogtreecommitdiff
path: root/crypto/crypto_user.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2016-02-17 10:37:36 +0100
committerIngo Molnar <mingo@kernel.org>2016-02-17 10:37:36 +0100
commit9109dc97b0155e500cdf3bcd91507bc24defefc1 (patch)
tree5d721cbfeb3576dc6969093ab04f17666737b6a4 /crypto/crypto_user.c
parent27f6d22b037b2be6685e0e27cce929779d634119 (diff)
parent059fcd8cd16622da6513804a7a3e826d152c6c96 (diff)
Merge branch 'perf/urgent' into perf/core, to queue up dependent patch
Signed-off-by: Ingo Molnar <mingo@kernel.org>
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 237f3795cfaaa..43fe85f20d577 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)
if (link->dump == NULL)
return -EINVAL;
+ down_read(&crypto_alg_sem);
list_for_each_entry(alg, &crypto_alg_list, cra_list)
dump_alloc += CRYPTO_REPORT_MAXSIZE;
@@ -508,8 +509,11 @@ static int crypto_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
.done = link->done,
.min_dump_alloc = dump_alloc,
};
- return netlink_dump_start(crypto_nlsk, skb, nlh, &c);
+ err = netlink_dump_start(crypto_nlsk, skb, nlh, &c);
}
+ up_read(&crypto_alg_sem);
+
+ return err;
}
err = nlmsg_parse(nlh, crypto_msg_min[type], attrs, CRYPTOCFGA_MAX,