aboutsummaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorAlex Shi <alex.shi@linaro.org>2016-03-14 14:33:17 +0800
committerAlex Shi <alex.shi@linaro.org>2016-03-14 14:33:17 +0800
commit405b4c1452cb59ce07632a60d3e3152ab9243ae6 (patch)
tree68efc4424ee51666fc0153d406f3b05dc43ff139 /crypto
parent4375255906557444b034ca1b24603b29945276cf (diff)
parent82211c838b558293e48c8fcd816f6609ebc7e4b3 (diff)
Merge branch 'linux-linaro-lsk-v3.18' into linux-linaro-lsk-v3.18-android
Diffstat (limited to 'crypto')
-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 c90af2537d24..c571d85cfad7 100644
--- a/crypto/crypto_user.c
+++ b/crypto/crypto_user.c
@@ -483,6 +483,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;
@@ -492,8 +493,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,