Skip to content

Commit

Permalink
MPILIB: Add a missing ENOMEM check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
dhowells authored and James Morris committed Jan 19, 2012
1 parent f59e842 commit 4bf1924
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/mpi/mpicoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 4bf1924

Please sign in to comment.