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.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/crypto/mpi/mpiutil.c b/lib/crypto/mpi/mpiutil.c
index 979ece5a81d2..f4faf7c903f9 100644
--- a/lib/crypto/mpi/mpiutil.c
+++ b/lib/crypto/mpi/mpiutil.c
@@ -18,6 +18,8 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
+#include <linux/export.h>
+
#include "mpi-internal.h"
/****************
@@ -31,7 +33,7 @@ MPI mpi_alloc(unsigned nlimbs)
{
MPI a;
- a = kmalloc(sizeof *a, GFP_KERNEL);
+ a = kmalloc_obj(*a);
if (!a)
return a;
@@ -91,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);
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);
if (!a->d)
return -ENOMEM;
}