Commit d5ffebdd authored by Mike Snitzer's avatar Mike Snitzer
Browse files

dm: backfill missing calls to mutex_destroy()



Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent ae1093be
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -2192,6 +2192,8 @@ static void crypt_dtr(struct dm_target *ti)
	kzfree(cc->cipher_auth);
	kzfree(cc->authenc_key);

	mutex_destroy(&cc->bio_alloc_lock);

	/* Must zero key material before freeing */
	kzfree(cc);
}
+2 −0
Original line number Diff line number Diff line
@@ -229,6 +229,8 @@ static void delay_dtr(struct dm_target *ti)
	if (dc->dev_write)
		dm_put_device(ti, dc->dev_write);

	mutex_destroy(&dc->timer_lock);

	kfree(dc);
}

+4 −2
Original line number Diff line number Diff line
@@ -477,8 +477,10 @@ static int run_complete_job(struct kcopyd_job *job)
	 * If this is the master job, the sub jobs have already
	 * completed so we can free everything.
	 */
	if (job->master_job == job)
	if (job->master_job == job) {
		mutex_destroy(&job->lock);
		mempool_free(job, kc->job_pool);
	}
	fn(read_err, write_err, context);

	if (atomic_dec_and_test(&kc->nr_jobs))
@@ -750,6 +752,7 @@ int dm_kcopyd_copy(struct dm_kcopyd_client *kc, struct dm_io_region *from,
	 * followed by SPLIT_COUNT sub jobs.
	 */
	job = mempool_alloc(kc->job_pool, GFP_NOIO);
	mutex_init(&job->lock);

	/*
	 * set up for the read.
@@ -811,7 +814,6 @@ int dm_kcopyd_copy(struct dm_kcopyd_client *kc, struct dm_io_region *from,
	if (job->source.count <= SUB_JOB_SIZE)
		dispatch_job(job);
	else {
		mutex_init(&job->lock);
		job->progress = 0;
		split_job(job);
	}
+1 −0
Original line number Diff line number Diff line
@@ -248,6 +248,7 @@ static void free_multipath(struct multipath *m)

	kfree(m->hw_handler_name);
	kfree(m->hw_handler_params);
	mutex_destroy(&m->work_mutex);
	kfree(m);
}

+1 −0
Original line number Diff line number Diff line
@@ -228,6 +228,7 @@ void dm_stats_cleanup(struct dm_stats *stats)
		dm_stat_free(&s->rcu_head);
	}
	free_percpu(stats->last);
	mutex_destroy(&stats->mutex);
}

static int dm_stats_create(struct dm_stats *stats, sector_t start, sector_t end,
Loading