MPILIB: Add a missing ENOMEM check
PATCH 1/1 MPILIB: Add a missing ENOMEM check
Add a missing ENOMEM check.
Signed-off-by David Howells <[email protected]>
Acked-by Mimi Zohar <[email protected]>
---
lib/mpi/mpicoder.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
lib/mpi/mpicoder.c +2 -0
@@ -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];
Quoted 4 lines · David Howells
Add a missing ENOMEM check.
Signed-off-by David Howells <[email protected]>Acked-by Mimi Zohar <[email protected]>
Thanks.
Quoted 23 lines
---
lib/mpi/mpicoder.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)lib/mpi/mpicoder.c +0
-0@@ -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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 4 lines · David Howells
Add a missing ENOMEM check.
Signed-off-by David Howells <[email protected]>Acked-by Mimi Zohar <[email protected]>
Actually, this one doesn't need to go into stable as the code being patched only went in in this merge window.
David