diff options
author | Jesper Juhl <jesper.juhl@gmail.com> | 2005-11-07 04:01:30 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-07 10:54:03 -0500 |
commit | 17fd682e544556a2a829e94383239c029bb21c5e (patch) | |
tree | 4b78bdd36efdbf9fb2c4c11382ed88898ceec48c /drivers/s390/block/dasd.c | |
parent | 3c7208f253571ee5f157b98f0e315b5172afe092 (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/dasd.c')
-rw-r--r-- | drivers/s390/block/dasd.c | 12 |
1 files changed, 4 insertions, 8 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) | |||
115 | void | 115 | void |
116 | dasd_free_device(struct dasd_device *device) | 116 | dasd_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 | } |