aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/char/keyboard.c
diff options
context:
space:
mode:
authorJesper Juhl <jesper.juhl@gmail.com>2005-11-07 04:01:30 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-07 10:54:03 -0500
commit17fd682e544556a2a829e94383239c029bb21c5e (patch)
tree4b78bdd36efdbf9fb2c4c11382ed88898ceec48c /drivers/s390/char/keyboard.c
parent3c7208f253571ee5f157b98f0e315b5172afe092 (diff)
[PATCH] kfree cleanup: drivers/s390
This is the drivers/s390/ part of the big kfree cleanup patch. Remove pointless checks for NULL prior to calling kfree() in drivers/s390/. Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Acked-by: Cornelia Huck <cohuck@de.ibm.com> Acked-by: Stefan Bader <Stefan.Bader@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/s390/char/keyboard.c')
-rw-r--r--drivers/s390/char/keyboard.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/s390/char/keyboard.c b/drivers/s390/char/keyboard.c
index fd43d99b45a3..5bda2340a39d 100644
--- a/drivers/s390/char/keyboard.c
+++ b/drivers/s390/char/keyboard.c
@@ -99,13 +99,11 @@ out_fn_handler:
99 kfree(kbd->fn_handler); 99 kfree(kbd->fn_handler);
100out_func: 100out_func:
101 for (i = 0; i < ARRAY_SIZE(func_table); i++) 101 for (i = 0; i < ARRAY_SIZE(func_table); i++)
102 if (kbd->func_table[i]) 102 kfree(kbd->func_table[i]);
103 kfree(kbd->func_table[i]);
104 kfree(kbd->func_table); 103 kfree(kbd->func_table);
105out_maps: 104out_maps:
106 for (i = 0; i < ARRAY_SIZE(key_maps); i++) 105 for (i = 0; i < ARRAY_SIZE(key_maps); i++)
107 if (kbd->key_maps[i]) 106 kfree(kbd->key_maps[i]);
108 kfree(kbd->key_maps[i]);
109 kfree(kbd->key_maps); 107 kfree(kbd->key_maps);
110out_kbd: 108out_kbd:
111 kfree(kbd); 109 kfree(kbd);
@@ -121,12 +119,10 @@ kbd_free(struct kbd_data *kbd)
121 kfree(kbd->accent_table); 119 kfree(kbd->accent_table);
122 kfree(kbd->fn_handler); 120 kfree(kbd->fn_handler);
123 for (i = 0; i < ARRAY_SIZE(func_table); i++) 121 for (i = 0; i < ARRAY_SIZE(func_table); i++)
124 if (kbd->func_table[i]) 122 kfree(kbd->func_table[i]);
125 kfree(kbd->func_table[i]);
126 kfree(kbd->func_table); 123 kfree(kbd->func_table);
127 for (i = 0; i < ARRAY_SIZE(key_maps); i++) 124 for (i = 0; i < ARRAY_SIZE(key_maps); i++)
128 if (kbd->key_maps[i]) 125 kfree(kbd->key_maps[i]);
129 kfree(kbd->key_maps[i]);
130 kfree(kbd->key_maps); 126 kfree(kbd->key_maps);
131 kfree(kbd); 127 kfree(kbd);
132} 128}
@@ -452,8 +448,7 @@ do_kdgkb_ioctl(struct kbd_data *kbd, struct kbsentry __user *u_kbs,
452 return -EFAULT; 448 return -EFAULT;
453 } 449 }
454 p[len] = 0; 450 p[len] = 0;
455 if (kbd->func_table[kb_func]) 451 kfree(kbd->func_table[kb_func]);
456 kfree(kbd->func_table[kb_func]);
457 kbd->func_table[kb_func] = p; 452 kbd->func_table[kb_func] = p;
458 break; 453 break;
459 } 454 }