summaryrefslogtreecommitdiff
path: root/lib/crypto/mpi/mpiutil.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/crypto/mpi/mpiutil.c')
-rw-r--r--lib/crypto/mpi/mpiutil.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/crypto/mpi/mpiutil.c b/lib/crypto/mpi/mpiutil.c
index 7f2db830f404..4999f756f50e 100644
--- a/lib/crypto/mpi/mpiutil.c
+++ b/lib/crypto/mpi/mpiutil.c
@@ -33,7 +33,7 @@ MPI mpi_alloc(unsigned nlimbs)
{
MPI a;
- a = kmalloc(sizeof *a, GFP_KERNEL);
+ a = kmalloc_obj(*a, GFP_KERNEL);
if (!a)
return a;
@@ -93,14 +93,14 @@ int mpi_resize(MPI a, unsigned nlimbs)
return 0; /* no need to do it */
if (a->d) {
- p = kcalloc(nlimbs, sizeof(mpi_limb_t), GFP_KERNEL);
+ p = kzalloc_objs(mpi_limb_t, nlimbs, GFP_KERNEL);
if (!p)
return -ENOMEM;
memcpy(p, a->d, a->alloced * sizeof(mpi_limb_t));
kfree_sensitive(a->d);
a->d = p;
} else {
- a->d = kcalloc(nlimbs, sizeof(mpi_limb_t), GFP_KERNEL);
+ a->d = kzalloc_objs(mpi_limb_t, nlimbs, GFP_KERNEL);
if (!a->d)
return -ENOMEM;
}