]> err.no Git - linux-2.6/blobdiff - drivers/crypto/padlock-aes.c
Merge branch 'upstream'
[linux-2.6] / drivers / crypto / padlock-aes.c
index 0c08c58252befe58443db9241893424dfad7ef5a..5158a9db4bc58faeabd16b44a7ed2221cbd141ed 100644 (file)
@@ -284,7 +284,11 @@ aes_hw_extkey_available(uint8_t key_len)
 
 static inline struct aes_ctx *aes_ctx(void *ctx)
 {
-       return (struct aes_ctx *)ALIGN((unsigned long)ctx, PADLOCK_ALIGNMENT);
+       unsigned long align = PADLOCK_ALIGNMENT;
+
+       if (align <= crypto_tfm_ctx_alignment())
+               align = 1;
+       return (struct aes_ctx *)ALIGN((unsigned long)ctx, align);
 }
 
 static int