summaryrefslogtreecommitdiff
path: root/drivers/crypto/caam/caamalg.c
diff options
context:
space:
mode:
authorKim Phillips <kim.phillips@freescale.com>2011-05-02 23:29:17 (GMT)
committerHerbert Xu <herbert@gondor.apana.org.au>2011-05-04 05:15:06 (GMT)
commitde2954d66408da3ae34effda777bb564fd17781b (patch)
tree4d2c85fd33cfb72ebcb6870320eba3e5f4a22a70 /drivers/crypto/caam/caamalg.c
parent701af31ce0cc6a1114001d792c21108c7f49ac86 (diff)
downloadlinux-fsl-qoriq-de2954d66408da3ae34effda777bb564fd17781b.tar.xz
crypto: caam - fix printk recursion for long error texts
during recent descriptor development, an Invalid Sequence Command error triggered a: BUG: recent printk recursion! due to insufficient memory allocated for the error text. The Invalid Sequence Command error text is the longest. The length of the maximum error string is computed as the sum of: "DECO: ": 6 "jump tgt desc idx 255: ": 23 Invalid Sequence Command text: 272 zero termination character: 1 i.e, 302 characters. Define this maximum error string length in error.h and fix caam_jr_strstatus callsites. Signed-off-by: Kim Phillips <kim.phillips@freescale.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/caam/caamalg.c')
-rw-r--r--drivers/crypto/caam/caamalg.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c
index 5c16019..b97575e 100644
--- a/drivers/crypto/caam/caamalg.c
+++ b/drivers/crypto/caam/caamalg.c
@@ -113,7 +113,7 @@ static void split_key_done(struct device *dev, u32 *desc, u32 err,
dev_err(dev, "%s %d: err 0x%x\n", __func__, __LINE__, err);
#endif
if (err) {
- char tmp[256];
+ char tmp[CAAM_ERROR_STR_MAX];
dev_err(dev, "%08x: %s\n", err, caam_jr_strstatus(tmp, err));
}
@@ -414,7 +414,7 @@ static void ipsec_esp_encrypt_done(struct device *jrdev, u32 *desc, u32 err,
offsetof(struct ipsec_esp_edesc, hw_desc));
if (err) {
- char tmp[256];
+ char tmp[CAAM_ERROR_STR_MAX];
dev_err(jrdev, "%08x: %s\n", err, caam_jr_strstatus(tmp, err));
}
@@ -454,7 +454,7 @@ static void ipsec_esp_decrypt_done(struct device *jrdev, u32 *desc, u32 err,
offsetof(struct ipsec_esp_edesc, hw_desc));
if (err) {
- char tmp[256];
+ char tmp[CAAM_ERROR_STR_MAX];
dev_err(jrdev, "%08x: %s\n", err, caam_jr_strstatus(tmp, err));
}