aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds2014-05-21 18:34:35 +0900
committerLinus Torvalds2014-05-21 18:34:35 +0900
commit1f5518b4e7febc2a1026fba2ff311ba54be1abc4 (patch)
treeb637d1d99b876ae6ef721bcfe164a1338b958332 /drivers
parenta7aa96a92eff3c4b2c7df8c8535691a5a487207d (diff)
parent3901c1124ec5099254a9396085f7798153a7293f (diff)
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.c10
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)