[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120118100354.20549.9321.stgit@warthog.procyon.org.uk>
Date: Wed, 18 Jan 2012 10:03:54 +0000
From: David Howells <dhowells@...hat.com>
To: jmorris@...ei.org
Cc: keyrings@...ux-nfs.org, linux-security-module@...r.kernel.org,
linux-kernel@...r.kernel.org, stable@...nel.org,
David Howells <dhowells@...hat.com>,
Mimi Zohar <zohar@...ibm.com>
Subject: [PATCH] MPILIB: Add a missing ENOMEM check
Add a missing ENOMEM check.
Signed-off-by: David Howells <dhowells@...hat.com>
Acked-by: Mimi Zohar <zohar@...ibm.com>
---
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 fe84bb9..716802b 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)
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];
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists