Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 09b35b41 authored by Dave Rodgman's avatar Dave Rodgman Committed by Linus Torvalds
Browse files

lib/lzo/lzo1x_compress.c: fix alignment bug in lzo-rle

Fix an unaligned access which breaks on platforms where this is not
permitted (e.g., Sparc).

Link: http://lkml.kernel.org/r/20190912145502.35229-1-dave.rodgman@arm.com


Signed-off-by: default avatarDave Rodgman <dave.rodgman@arm.com>
Cc: Dave Rodgman <dave.rodgman@arm.com>
Cc: Markus F.X.J. Oberhumer <markus@oberhumer.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 984035ad
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -83,6 +83,7 @@ lzo1x_1_do_compress(const unsigned char *in, size_t in_len,
					ALIGN((uintptr_t)ir, 4)) &&
					(ir < limit) && (*ir == 0))
				ir++;
			if (IS_ALIGNED((uintptr_t)ir, 4)) {
				for (; (ir + 4) <= limit; ir += 4) {
					dv = *((u32 *)ir);
					if (dv) {
@@ -96,6 +97,7 @@ lzo1x_1_do_compress(const unsigned char *in, size_t in_len,
						break;
					}
				}
			}
#endif
			while (likely(ir < limit) && unlikely(*ir == 0))
				ir++;