Commit 4bf1924c authored by David Howells's avatar David Howells Committed by James Morris

MPILIB: Add a missing ENOMEM check

Add a missing ENOMEM check.
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Acked-by: default avatarMimi Zohar <zohar@us.ibm.com>
Signed-off-by: default avatarJames Morris <jmorris@namei.org>
parent f59e842f
...@@ -255,6 +255,8 @@ void *mpi_get_buffer(MPI a, unsigned *nbytes, int *sign) ...@@ -255,6 +255,8 @@ void *mpi_get_buffer(MPI a, unsigned *nbytes, int *sign)
if (!n) if (!n)
n++; /* avoid zero length allocation */ n++; /* avoid zero length allocation */
p = buffer = kmalloc(n, GFP_KERNEL); p = buffer = kmalloc(n, GFP_KERNEL);
if (!p)
return NULL;
for (i = a->nlimbs - 1; i >= 0; i--) { for (i = a->nlimbs - 1; i >= 0; i--) {
alimb = a->d[i]; alimb = a->d[i];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment