aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/crypto/z90main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/crypto/z90main.c')
-rw-r--r--drivers/s390/crypto/z90main.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/s390/crypto/z90main.c b/drivers/s390/crypto/z90main.c
index 977ecd9ba6bd..982acc7303ea 100644
--- a/drivers/s390/crypto/z90main.c
+++ b/drivers/s390/crypto/z90main.c
@@ -707,13 +707,12 @@ z90crypt_open(struct inode *inode, struct file *filp)
707 if (quiesce_z90crypt) 707 if (quiesce_z90crypt)
708 return -EQUIESCE; 708 return -EQUIESCE;
709 709
710 private_data_p = kmalloc(sizeof(struct priv_data), GFP_KERNEL); 710 private_data_p = kzalloc(sizeof(struct priv_data), GFP_KERNEL);
711 if (!private_data_p) { 711 if (!private_data_p) {
712 PRINTK("Memory allocate failed\n"); 712 PRINTK("Memory allocate failed\n");
713 return -ENOMEM; 713 return -ENOMEM;
714 } 714 }
715 715
716 memset((void *)private_data_p, 0, sizeof(struct priv_data));
717 private_data_p->status = STAT_OPEN; 716 private_data_p->status = STAT_OPEN;
718 private_data_p->opener_pid = PID(); 717 private_data_p->opener_pid = PID();
719 filp->private_data = private_data_p; 718 filp->private_data = private_data_p;
@@ -2737,13 +2736,11 @@ create_z90crypt(int *cdx_p)
2737 z90crypt.max_count = Z90CRYPT_NUM_DEVS; 2736 z90crypt.max_count = Z90CRYPT_NUM_DEVS;
2738 z90crypt.cdx = *cdx_p; 2737 z90crypt.cdx = *cdx_p;
2739 2738
2740 hdware_blk_p = (struct hdware_block *) 2739 hdware_blk_p = kzalloc(sizeof(struct hdware_block), GFP_ATOMIC);
2741 kmalloc(sizeof(struct hdware_block), GFP_ATOMIC);
2742 if (!hdware_blk_p) { 2740 if (!hdware_blk_p) {
2743 PDEBUG("kmalloc for hardware block failed\n"); 2741 PDEBUG("kmalloc for hardware block failed\n");
2744 return ENOMEM; 2742 return ENOMEM;
2745 } 2743 }
2746 memset(hdware_blk_p, 0x00, sizeof(struct hdware_block));
2747 z90crypt.hdware_info = hdware_blk_p; 2744 z90crypt.hdware_info = hdware_blk_p;
2748 2745
2749 return 0; 2746 return 0;
@@ -2978,12 +2975,11 @@ create_crypto_device(int index)
2978 total_size = sizeof(struct device) + 2975 total_size = sizeof(struct device) +
2979 z90crypt.q_depth_array[index] * sizeof(int); 2976 z90crypt.q_depth_array[index] * sizeof(int);
2980 2977
2981 dev_ptr = (struct device *) kmalloc(total_size, GFP_ATOMIC); 2978 dev_ptr = kzalloc(total_size, GFP_ATOMIC);
2982 if (!dev_ptr) { 2979 if (!dev_ptr) {
2983 PRINTK("kmalloc device %d failed\n", index); 2980 PRINTK("kmalloc device %d failed\n", index);
2984 return ENOMEM; 2981 return ENOMEM;
2985 } 2982 }
2986 memset(dev_ptr, 0, total_size);
2987 dev_ptr->dev_resp_p = kmalloc(MAX_RESPONSE_SIZE, GFP_ATOMIC); 2983 dev_ptr->dev_resp_p = kmalloc(MAX_RESPONSE_SIZE, GFP_ATOMIC);
2988 if (!dev_ptr->dev_resp_p) { 2984 if (!dev_ptr->dev_resp_p) {
2989 kfree(dev_ptr); 2985 kfree(dev_ptr);