summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorFuqian Huang <huangfq.daxian@gmail.com>2019-06-28 10:47:34 +0800
committerMike Snitzer <snitzer@redhat.com>2019-07-09 14:14:20 -0400
commit131670c2625307551c23970ebcc0f8bc0fc9b4ef (patch)
tree8e0fdee91c67b8ffd68a38dd2d03a9b6d0a9e76d /drivers
parentd370ad23a5553f9128da24e029993f4091bc04d7 (diff)
downloadlinux-131670c2625307551c23970ebcc0f8bc0fc9b4ef.tar.bz2
dm integrity: use kzalloc() instead of kmalloc() + memset()
Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/md/dm-integrity.c3
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)
goto bad;
}
- crypt_iv = kmalloc(ivsize, GFP_KERNEL);
+ crypt_iv = kzalloc(ivsize, GFP_KERNEL);
if (!crypt_iv) {
*error = "Could not allocate iv";
r = -ENOMEM;
@@ -3389,7 +3389,6 @@ static int create_journal(struct dm_integrity_c *ic, char **error)
sg_set_buf(&sg[i], va, PAGE_SIZE);
}
sg_set_buf(&sg[i], &ic->commit_ids, sizeof ic->commit_ids);
- memset(crypt_iv, 0x00, ivsize);
skcipher_request_set_crypt(req, sg, sg,
PAGE_SIZE * ic->journal_pages + sizeof ic->commit_ids, crypt_iv);