public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MPILIB: Add a missing ENOMEM check
@ 2012-01-18 10:03 David Howells
  2012-01-18 10:38 ` Kasatkin, Dmitry
  2012-01-18 14:00 ` David Howells
  0 siblings, 2 replies; 3+ messages in thread
From: David Howells @ 2012-01-18 10:03 UTC (permalink / raw)
  To: jmorris
  Cc: keyrings, linux-security-module, linux-kernel, stable,
	David Howells, Mimi Zohar

Add a missing ENOMEM check.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Mimi Zohar <zohar@us.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];


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-01-18 14:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-18 10:03 [PATCH] MPILIB: Add a missing ENOMEM check David Howells
2012-01-18 10:38 ` Kasatkin, Dmitry
2012-01-18 14:00 ` David Howells

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox