diff options
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 | } |