summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-inlinecrypt.c2
-rw-r--r--drivers/md/md-llbitmap.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/md/dm-inlinecrypt.c b/drivers/md/dm-inlinecrypt.c
index 66fa2f9d1fdc..3479dfe5f708 100644
--- a/drivers/md/dm-inlinecrypt.c
+++ b/drivers/md/dm-inlinecrypt.c
@@ -322,7 +322,7 @@ static int inlinecrypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
return -EINVAL;
}
- ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
+ ctx = kzalloc_obj(*ctx);
if (!ctx) {
ti->error = "Out of memory";
return -ENOMEM;
diff --git a/drivers/md/md-llbitmap.c b/drivers/md/md-llbitmap.c
index e1a783ee2032..1c9fcc746ec6 100644
--- a/drivers/md/md-llbitmap.c
+++ b/drivers/md/md-llbitmap.c
@@ -810,7 +810,7 @@ static int llbitmap_expand_pages(struct llbitmap *llbitmap,
if (nr_pages <= old_nr_pages)
return 0;
- pctl = kcalloc(nr_pages, sizeof(*pctl), GFP_NOIO);
+ pctl = kzalloc_objs(*pctl, nr_pages, GFP_NOIO);
if (!pctl)
return -ENOMEM;
@@ -846,7 +846,7 @@ static int llbitmap_alloc_pages(struct llbitmap *llbitmap)
unsigned int nr_pages = max(used_pages, llbitmap_reserved_pages(llbitmap));
int i;
- llbitmap->pctl = kcalloc(nr_pages, sizeof(*llbitmap->pctl), GFP_NOIO);
+ llbitmap->pctl = kzalloc_objs(*llbitmap->pctl, nr_pages, GFP_NOIO);
if (!llbitmap->pctl)
return -ENOMEM;