diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-05-21 11:34:35 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-05-21 11:34:35 +0200 |
commit | 1f5518b4e7febc2a1026fba2ff311ba54be1abc4 (patch) | |
tree | b637d1d99b876ae6ef721bcfe164a1338b958332 /drivers | |
parent | Merge git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending (diff) | |
parent | crypto: s390 - fix aes,des ctr mode concurrency finding. (diff) | |
download | linux-1f5518b4e7febc2a1026fba2ff311ba54be1abc4.tar.xz linux-1f5518b4e7febc2a1026fba2ff311ba54be1abc4.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fixes from Herbert Xu:
"This fixes a NULL pointer dereference on allocation failure in caam,
as well as a regression in the ctr mode on s390 that was added with
the recent concurrency fixes"
* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
crypto: s390 - fix aes,des ctr mode concurrency finding.
crypto: caam - add allocation failure handling in SPRINTFCAT macro
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/crypto/caam/error.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/crypto/caam/error.c b/drivers/crypto/caam/error.c index 9f25f5296029..0eabd81e1a90 100644 --- a/drivers/crypto/caam/error.c +++ b/drivers/crypto/caam/error.c @@ -16,9 +16,13 @@ char *tmp; \ \ tmp = kmalloc(sizeof(format) + max_alloc, GFP_ATOMIC); \ - sprintf(tmp, format, param); \ - strcat(str, tmp); \ - kfree(tmp); \ + if (likely(tmp)) { \ + sprintf(tmp, format, param); \ + strcat(str, tmp); \ + kfree(tmp); \ + } else { \ + strcat(str, "kmalloc failure in SPRINTFCAT"); \ + } \ } static void report_jump_idx(u32 status, char *outstr) |