1
0
Fork 0

MPILIB: Add a missing ENOMEM check

Add a missing ENOMEM check.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Mimi Zohar <zohar@us.ibm.com>
Signed-off-by: James Morris <jmorris@namei.org>
hifive-unleashed-5.1
David Howells 2012-01-18 10:03:54 +00:00 committed by James Morris
parent f59e842fc0
commit 4bf1924c00
1 changed files with 2 additions and 0 deletions

View File

@ -255,6 +255,8 @@ void *mpi_get_buffer(MPI a, unsigned *nbytes, int *sign)
if (!n)
n++; /* avoid zero length allocation */
p = buffer = kmalloc(n, GFP_KERNEL);
if (!p)
return NULL;
for (i = a->nlimbs - 1; i >= 0; i--) {
alimb = a->d[i];