diff options
-rw-r--r-- | drivers/md/dm-log.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/md/dm-log.c b/drivers/md/dm-log.c index a8c0fc79ca78..13e2a1a1a941 100644 --- a/drivers/md/dm-log.c +++ b/drivers/md/dm-log.c | |||
@@ -467,6 +467,7 @@ static int create_log_context(struct dm_dirty_log *log, struct dm_target *ti, | |||
467 | lc->disk_header = vmalloc(buf_size); | 467 | lc->disk_header = vmalloc(buf_size); |
468 | if (!lc->disk_header) { | 468 | if (!lc->disk_header) { |
469 | DMWARN("couldn't allocate disk log buffer"); | 469 | DMWARN("couldn't allocate disk log buffer"); |
470 | dm_io_client_destroy(lc->io_req.client); | ||
470 | kfree(lc); | 471 | kfree(lc); |
471 | return -ENOMEM; | 472 | return -ENOMEM; |
472 | } | 473 | } |
@@ -482,6 +483,8 @@ static int create_log_context(struct dm_dirty_log *log, struct dm_target *ti, | |||
482 | DMWARN("couldn't allocate sync bitset"); | 483 | DMWARN("couldn't allocate sync bitset"); |
483 | if (!dev) | 484 | if (!dev) |
484 | vfree(lc->clean_bits); | 485 | vfree(lc->clean_bits); |
486 | else | ||
487 | dm_io_client_destroy(lc->io_req.client); | ||
485 | vfree(lc->disk_header); | 488 | vfree(lc->disk_header); |
486 | kfree(lc); | 489 | kfree(lc); |
487 | return -ENOMEM; | 490 | return -ENOMEM; |
@@ -495,6 +498,8 @@ static int create_log_context(struct dm_dirty_log *log, struct dm_target *ti, | |||
495 | vfree(lc->sync_bits); | 498 | vfree(lc->sync_bits); |
496 | if (!dev) | 499 | if (!dev) |
497 | vfree(lc->clean_bits); | 500 | vfree(lc->clean_bits); |
501 | else | ||
502 | dm_io_client_destroy(lc->io_req.client); | ||
498 | vfree(lc->disk_header); | 503 | vfree(lc->disk_header); |
499 | kfree(lc); | 504 | kfree(lc); |
500 | return -ENOMEM; | 505 | return -ENOMEM; |