Skip to contentSkip to conversation

crypto: memneq: fix for archs without efficient unaligned access

PATCH In review Daniel Borkmann 2 participants 2 messages Dec 5, 2013 – Dec 9, 2013 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: memneq: fix for archs without efficient unaligned access

Commit fe8c8a126806 introduced a possible build error for archs that do not have CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS set. :/ Fix this up by bringing else braces outside of the ifdef.

Fixes fe8c8a126806 ("crypto: more robust crypto_memneq")
Cc Cesar Eduardo Barros <[email protected]>

---
Sending stand-alone fix as original patch is already applied.

 crypto/memneq.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
crypto/memneq.c +2 -1
index 570f6f3..afed1bd 100644
@@ -108,8 +108,9 @@ static inline unsigned long __crypto_memneq_16(const void *a, const void *b)
 		OPTIMIZER_HIDE_VAR(neq);
 		neq |= *(unsigned int *)(a+12) ^ *(unsigned int *)(b+12);
 		OPTIMIZER_HIDE_VAR(neq);
-	} else {
+	} else
 #endif /* CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS */
+	{
 		neq |= *(unsigned char *)(a)    ^ *(unsigned char *)(b);
 		OPTIMIZER_HIDE_VAR(neq);
 		neq |= *(unsigned char *)(a+1)  ^ *(unsigned char *)(b+1);
Signature · 1 line
1.8.3.1
maintainer
#1 lore raw
Quoted 8 lines · Daniel Borkmann

Commit fe8c8a126806 introduced a possible build error for archs that do not have CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS set. :/ Fix this up by bringing else braces outside of the ifdef.

Fixes fe8c8a126806 ("crypto: more robust crypto_memneq")
Cc Cesar Eduardo Barros <[email protected]>

Patch applied. Thanks!

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt