diff options
-rw-r--r-- | drivers/md/dm-crypt.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 3bdbb6115702..a8aab9cf26b9 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c | |||
@@ -1168,12 +1168,11 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv) | |||
1168 | if (ivmode && cc->iv_gen_ops) { | 1168 | if (ivmode && cc->iv_gen_ops) { |
1169 | if (ivopts) | 1169 | if (ivopts) |
1170 | *(ivopts - 1) = ':'; | 1170 | *(ivopts - 1) = ':'; |
1171 | cc->iv_mode = kmalloc(strlen(ivmode) + 1, GFP_KERNEL); | 1171 | cc->iv_mode = kstrdup(ivmode, GFP_KERNEL); |
1172 | if (!cc->iv_mode) { | 1172 | if (!cc->iv_mode) { |
1173 | ti->error = "Error kmallocing iv_mode string"; | 1173 | ti->error = "Error kmallocing iv_mode string"; |
1174 | goto bad_ivmode_string; | 1174 | goto bad_ivmode_string; |
1175 | } | 1175 | } |
1176 | strcpy(cc->iv_mode, ivmode); | ||
1177 | } else | 1176 | } else |
1178 | cc->iv_mode = NULL; | 1177 | cc->iv_mode = NULL; |
1179 | 1178 | ||