diff mbox

[2/7] dm crypt: remove redundant setkey call

Message ID 96a50ca507cdb1433729f5321136d159ea5fd3f4.1292944625.git.mbroz@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Alasdair Kergon
Headers show

Commit Message

Milan Broz Dec. 21, 2010, 3:28 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index 6aeb1fe..dbed83d 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -1317,10 +1317,9 @@  bad_mem:
 static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
 {
 	struct crypt_config *cc;
-	struct crypt_cpu *cs;
 	unsigned int key_size;
 	unsigned long long tmpll;
-	int ret, cpu;
+	int ret;
 
 	if (argc != 5) {
 		ti->error = "Not enough arguments";
@@ -1372,14 +1371,6 @@  static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
 		goto bad;
 	}
 
-	for_each_possible_cpu(cpu) {
-		cs = per_cpu_ptr(cc->cpu, cpu);
-		if (crypto_ablkcipher_setkey(cs->tfm, cc->key, key_size) < 0) {
-			ti->error = "Error setting key";
-			goto bad;
-		}
-	}
-
 	ret = -EINVAL;
 	if (sscanf(argv[2], "%llu", &tmpll) != 1) {
 		ti->error = "Invalid iv_offset sector";