diff options
author | David Howells <dhowells@redhat.com> | 2012-01-18 05:03:54 -0500 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2012-01-18 21:45:51 -0500 |
commit | 4bf1924c008dffdc154f82507b4052e49263a6f4 (patch) | |
tree | 28ab539e07f662fcc4c179f411662e343be9520c /lib/mpi | |
parent | f59e842fc0871cd5baa213dc32e0ce8e5aaf4758 (diff) |
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>
Diffstat (limited to 'lib/mpi')
-rw-r--r-- | lib/mpi/mpicoder.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/mpi/mpicoder.c b/lib/mpi/mpicoder.c index fe84bb978e3b..716802b774ea 100644 --- a/lib/mpi/mpicoder.c +++ b/lib/mpi/mpicoder.c | |||
@@ -255,6 +255,8 @@ void *mpi_get_buffer(MPI a, unsigned *nbytes, int *sign) | |||
255 | if (!n) | 255 | if (!n) |
256 | n++; /* avoid zero length allocation */ | 256 | n++; /* avoid zero length allocation */ |
257 | p = buffer = kmalloc(n, GFP_KERNEL); | 257 | p = buffer = kmalloc(n, GFP_KERNEL); |
258 | if (!p) | ||
259 | return NULL; | ||
258 | 260 | ||
259 | for (i = a->nlimbs - 1; i >= 0; i--) { | 261 | for (i = a->nlimbs - 1; i >= 0; i--) { |
260 | alimb = a->d[i]; | 262 | alimb = a->d[i]; |