projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f59e842
)
MPILIB: Add a missing ENOMEM check
author
David Howells
<dhowells@redhat.com>
Wed, 18 Jan 2012 10:03:54 +0000
(10:03 +0000)
committer
James Morris
<jmorris@namei.org>
Thu, 19 Jan 2012 02:45:51 +0000
(13:45 +1100)
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>
lib/mpi/mpicoder.c
patch
|
blob
|
blame
|
history
diff --git
a/lib/mpi/mpicoder.c
b/lib/mpi/mpicoder.c
index fe84bb978e3b5c42befda57c206edd0b68d61684..716802b774ea9a92d58828cb1d7e99356098016b 100644
(file)
--- a/
lib/mpi/mpicoder.c
+++ b/
lib/mpi/mpicoder.c
@@
-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];