aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/block
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/block
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/block')
-rw-r--r--drivers/s390/block/dasd.c12
-rw-r--r--drivers/s390/block/dasd_devmap.c3
2 files changed, 5 insertions, 10 deletions
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index 8fc891a9d47f..7008d32433bf 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -115,8 +115,7 @@ dasd_alloc_device(void)
115void 115void
116dasd_free_device(struct dasd_device *device) 116dasd_free_device(struct dasd_device *device)
117{ 117{
118 if (device->private) 118 kfree(device->private);
119 kfree(device->private);
120 free_page((unsigned long) device->erp_mem); 119 free_page((unsigned long) device->erp_mem);
121 free_pages((unsigned long) device->ccw_mem, 1); 120 free_pages((unsigned long) device->ccw_mem, 1);
122 kfree(device); 121 kfree(device);
@@ -539,8 +538,7 @@ dasd_kmalloc_request(char *magic, int cplength, int datasize,
539 if (datasize > 0) { 538 if (datasize > 0) {
540 cqr->data = kmalloc(datasize, GFP_ATOMIC | GFP_DMA); 539 cqr->data = kmalloc(datasize, GFP_ATOMIC | GFP_DMA);
541 if (cqr->data == NULL) { 540 if (cqr->data == NULL) {
542 if (cqr->cpaddr != NULL) 541 kfree(cqr->cpaddr);
543 kfree(cqr->cpaddr);
544 kfree(cqr); 542 kfree(cqr);
545 return ERR_PTR(-ENOMEM); 543 return ERR_PTR(-ENOMEM);
546 } 544 }
@@ -615,10 +613,8 @@ dasd_kfree_request(struct dasd_ccw_req * cqr, struct dasd_device * device)
615 clear_normalized_cda(ccw); 613 clear_normalized_cda(ccw);
616 } while (ccw++->flags & (CCW_FLAG_CC | CCW_FLAG_DC)); 614 } while (ccw++->flags & (CCW_FLAG_CC | CCW_FLAG_DC));
617#endif 615#endif
618 if (cqr->cpaddr != NULL) 616 kfree(cqr->cpaddr);
619 kfree(cqr->cpaddr); 617 kfree(cqr->data);
620 if (cqr->data != NULL)
621 kfree(cqr->data);
622 kfree(cqr); 618 kfree(cqr);
623 dasd_put_device(device); 619 dasd_put_device(device);
624} 620}
diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c
index bda896d9d788..caee16a3dc62 100644
--- a/drivers/s390/block/dasd_devmap.c
+++ b/drivers/s390/block/dasd_devmap.c
@@ -387,8 +387,7 @@ dasd_add_busid(char *bus_id, int features)
387 new = 0; 387 new = 0;
388 } 388 }
389 spin_unlock(&dasd_devmap_lock); 389 spin_unlock(&dasd_devmap_lock);
390 if (new) 390 kfree(new);
391 kfree(new);
392 return devmap; 391 return devmap;
393} 392}
394 393