summaryrefslogtreecommitdiffstats
path: root/crypto/userspace/ncr.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/userspace/ncr.c')
-rw-r--r--crypto/userspace/ncr.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/crypto/userspace/ncr.c b/crypto/userspace/ncr.c
index 87faace90a5..ddbabe97f32 100644
--- a/crypto/userspace/ncr.c
+++ b/crypto/userspace/ncr.c
@@ -52,9 +52,6 @@ void* ncr_init_lists(void)
memset(lst, 0, sizeof(*lst));
- init_MUTEX(&lst->data.sem);
- INIT_LIST_HEAD(&lst->data.list);
-
init_MUTEX(&lst->key.sem);
INIT_LIST_HEAD(&lst->key.list);
@@ -106,11 +103,14 @@ struct ncr_master_key_st st;
dprintk(0, KERN_DEBUG, "Master key was previously initialized.\n");
}
+ if (unlikely(copy_from_user(master_key.key.secret.data, st.key, st.key_size))) {
+ err();
+ return -EFAULT;
+ }
+
dprintk(0, KERN_INFO, "Initializing master key.\n");
master_key.type = NCR_KEY_TYPE_SECRET;
-
- memcpy(master_key.key.secret.data, st.key, st.key_size);
master_key.key.secret.size = st.key_size;
return 0;