]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/crypto/padlock-aes.c
[IRDA]: stir4200, switching to the kthread API
[linux-2.6-omap-h63xx.git] / 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