aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/char
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
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')
-rw-r--r--drivers/s390/char/con3215.c3
-rw-r--r--drivers/s390/char/keyboard.c15
-rw-r--r--drivers/s390/char/raw3270.c3
-rw-r--r--drivers/s390/char/tape_core.c9
4 files changed, 10 insertions, 20 deletions
diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c
index f11a67fda40e..75419cf9d353 100644
--- a/drivers/s390/char/con3215.c
+++ b/drivers/s390/char/con3215.c
@@ -727,8 +727,7 @@ raw3215_remove (struct ccw_device *cdev)
727 raw = cdev->dev.driver_data; 727 raw = cdev->dev.driver_data;
728 if (raw) { 728 if (raw) {
729 cdev->dev.driver_data = NULL; 729 cdev->dev.driver_data = NULL;
730 if (raw->buffer) 730 kfree(raw->buffer);
731 kfree(raw->buffer);
732 kfree(raw); 731 kfree(raw);
733 } 732 }
734} 733}
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 }
diff --git a/drivers/s390/char/raw3270.c b/drivers/s390/char/raw3270.c
index d66946443dfc..f5b7d360fc10 100644
--- a/drivers/s390/char/raw3270.c
+++ b/drivers/s390/char/raw3270.c
@@ -183,8 +183,7 @@ raw3270_request_alloc_bootmem(size_t size)
183void 183void
184raw3270_request_free (struct raw3270_request *rq) 184raw3270_request_free (struct raw3270_request *rq)
185{ 185{
186 if (rq->buffer) 186 kfree(rq->buffer);
187 kfree(rq->buffer);
188 kfree(rq); 187 kfree(rq);
189} 188}
190 189
diff --git a/drivers/s390/char/tape_core.c b/drivers/s390/char/tape_core.c
index 6c52e8307dc5..8f486e1a8507 100644
--- a/drivers/s390/char/tape_core.c
+++ b/drivers/s390/char/tape_core.c
@@ -682,8 +682,7 @@ tape_alloc_request(int cplength, int datasize)
682 request->cpdata = kmalloc(datasize, GFP_KERNEL | GFP_DMA); 682 request->cpdata = kmalloc(datasize, GFP_KERNEL | GFP_DMA);
683 if (request->cpdata == NULL) { 683 if (request->cpdata == NULL) {
684 DBF_EXCEPTION(1, "cqra nomem\n"); 684 DBF_EXCEPTION(1, "cqra nomem\n");
685 if (request->cpaddr != NULL) 685 kfree(request->cpaddr);
686 kfree(request->cpaddr);
687 kfree(request); 686 kfree(request);
688 return ERR_PTR(-ENOMEM); 687 return ERR_PTR(-ENOMEM);
689 } 688 }
@@ -706,10 +705,8 @@ tape_free_request (struct tape_request * request)
706 if (request->device != NULL) { 705 if (request->device != NULL) {
707 request->device = tape_put_device(request->device); 706 request->device = tape_put_device(request->device);
708 } 707 }
709 if (request->cpdata != NULL) 708 kfree(request->cpdata);
710 kfree(request->cpdata); 709 kfree(request->cpaddr);
711 if (request->cpaddr != NULL)
712 kfree(request->cpaddr);
713 kfree(request); 710 kfree(request);
714} 711}
715 712