summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/mpi/mpiutil.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/mpi/mpiutil.c b/lib/mpi/mpiutil.c
index 6bfc41f62b8..26e4ed31e25 100644
--- a/lib/mpi/mpiutil.c
+++ b/lib/mpi/mpiutil.c
@@ -58,6 +58,9 @@ mpi_ptr_t mpi_alloc_limb_space(unsigned nlimbs)
{
size_t len = nlimbs * sizeof(mpi_limb_t);
+ if (!len)
+ return NULL;
+
return kmalloc(len, GFP_KERNEL);
}