aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/char/keyboard.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/char/keyboard.c')
-rw-r--r--drivers/s390/char/keyboard.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/s390/char/keyboard.c b/drivers/s390/char/keyboard.c
index a317a123daba..6badd8403409 100644
--- a/drivers/s390/char/keyboard.c
+++ b/drivers/s390/char/keyboard.c
@@ -50,14 +50,12 @@ kbd_alloc(void) {
50 struct kbd_data *kbd; 50 struct kbd_data *kbd;
51 int i, len; 51 int i, len;
52 52
53 kbd = kmalloc(sizeof(struct kbd_data), GFP_KERNEL); 53 kbd = kzalloc(sizeof(struct kbd_data), GFP_KERNEL);
54 if (!kbd) 54 if (!kbd)
55 goto out; 55 goto out;
56 memset(kbd, 0, sizeof(struct kbd_data)); 56 kbd->key_maps = kzalloc(sizeof(key_maps), GFP_KERNEL);
57 kbd->key_maps = kmalloc(sizeof(key_maps), GFP_KERNEL);
58 if (!key_maps) 57 if (!key_maps)
59 goto out_kbd; 58 goto out_kbd;
60 memset(kbd->key_maps, 0, sizeof(key_maps));
61 for (i = 0; i < ARRAY_SIZE(key_maps); i++) { 59 for (i = 0; i < ARRAY_SIZE(key_maps); i++) {
62 if (key_maps[i]) { 60 if (key_maps[i]) {
63 kbd->key_maps[i] = 61 kbd->key_maps[i] =
@@ -68,10 +66,9 @@ kbd_alloc(void) {
68 sizeof(u_short)*NR_KEYS); 66 sizeof(u_short)*NR_KEYS);
69 } 67 }
70 } 68 }
71 kbd->func_table = kmalloc(sizeof(func_table), GFP_KERNEL); 69 kbd->func_table = kzalloc(sizeof(func_table), GFP_KERNEL);
72 if (!kbd->func_table) 70 if (!kbd->func_table)
73 goto out_maps; 71 goto out_maps;
74 memset(kbd->func_table, 0, sizeof(func_table));
75 for (i = 0; i < ARRAY_SIZE(func_table); i++) { 72 for (i = 0; i < ARRAY_SIZE(func_table); i++) {
76 if (func_table[i]) { 73 if (func_table[i]) {
77 len = strlen(func_table[i]) + 1; 74 len = strlen(func_table[i]) + 1;
@@ -82,10 +79,9 @@ kbd_alloc(void) {
82 } 79 }
83 } 80 }
84 kbd->fn_handler = 81 kbd->fn_handler =
85 kmalloc(sizeof(fn_handler_fn *) * NR_FN_HANDLER, GFP_KERNEL); 82 kzalloc(sizeof(fn_handler_fn *) * NR_FN_HANDLER, GFP_KERNEL);
86 if (!kbd->fn_handler) 83 if (!kbd->fn_handler)
87 goto out_func; 84 goto out_func;
88 memset(kbd->fn_handler, 0, sizeof(fn_handler_fn *) * NR_FN_HANDLER);
89 kbd->accent_table = 85 kbd->accent_table =
90 kmalloc(sizeof(struct kbdiacr)*MAX_DIACR, GFP_KERNEL); 86 kmalloc(sizeof(struct kbdiacr)*MAX_DIACR, GFP_KERNEL);
91 if (!kbd->accent_table) 87 if (!kbd->accent_table)