diff options
| -rw-r--r-- | drivers/md/dm-integrity.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c index a2ab6a32b174..b1b0de402dfc 100644 --- a/drivers/md/dm-integrity.c +++ b/drivers/md/dm-integrity.c | |||
| @@ -3360,7 +3360,7 @@ static int create_journal(struct dm_integrity_c *ic, char **error) | |||
| 3360 | goto bad; | 3360 | goto bad; |
| 3361 | } | 3361 | } |
| 3362 | 3362 | ||
| 3363 | crypt_iv = kmalloc(ivsize, GFP_KERNEL); | 3363 | crypt_iv = kzalloc(ivsize, GFP_KERNEL); |
| 3364 | if (!crypt_iv) { | 3364 | if (!crypt_iv) { |
| 3365 | *error = "Could not allocate iv"; | 3365 | *error = "Could not allocate iv"; |
| 3366 | r = -ENOMEM; | 3366 | r = -ENOMEM; |
| @@ -3389,7 +3389,6 @@ static int create_journal(struct dm_integrity_c *ic, char **error) | |||
| 3389 | sg_set_buf(&sg[i], va, PAGE_SIZE); | 3389 | sg_set_buf(&sg[i], va, PAGE_SIZE); |
| 3390 | } | 3390 | } |
| 3391 | sg_set_buf(&sg[i], &ic->commit_ids, sizeof ic->commit_ids); | 3391 | sg_set_buf(&sg[i], &ic->commit_ids, sizeof ic->commit_ids); |
| 3392 | memset(crypt_iv, 0x00, ivsize); | ||
| 3393 | 3392 | ||
| 3394 | skcipher_request_set_crypt(req, sg, sg, | 3393 | skcipher_request_set_crypt(req, sg, sg, |
| 3395 | PAGE_SIZE * ic->journal_pages + sizeof ic->commit_ids, crypt_iv); | 3394 | PAGE_SIZE * ic->journal_pages + sizeof ic->commit_ids, crypt_iv); |
