linux-kernel.vger.kernel.org archive mirror
 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

* Re: [PATCH] MPILIB: Add a missing ENOMEM check
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Kasatkin, Dmitry @ 2012-01-18 10:38 UTC (permalink / raw)
  To: David Howells
  Cc: jmorris, keyrings, linux-security-module, linux-kernel, stable,
	Mimi Zohar

On Wed, Jan 18, 2012 at 12:03 PM, David Howells <dhowells@redhat.com> wrote:
> Add a missing ENOMEM check.
>
> Signed-off-by: David Howells <dhowells@redhat.com>
> Acked-by: Mimi Zohar <zohar@us.ibm.com>

Thanks.

> ---
>
>  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-security-module" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] MPILIB: Add a missing ENOMEM check
  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
  1 sibling, 0 replies; 3+ messages in thread
From: David Howells @ 2012-01-18 14:00 UTC (permalink / raw)
  To: stable
  Cc: dhowells, jmorris, keyrings, linux-security-module, linux-kernel,
	Mimi Zohar

David Howells <dhowells@redhat.com> wrote:

> Add a missing ENOMEM check.
> 
> Signed-off-by: David Howells <dhowells@redhat.com>
> Acked-by: Mimi Zohar <zohar@us.ibm.com>

Actually, this one doesn't need to go into stable as the code being patched
only went in in this merge window.

David

^ permalink raw reply	[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;
as well as URLs for NNTP newsgroup(s).