mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 18:09:56 +00:00
lib/lzo/lzo1x_compress.c: fix alignment bug in lzo-rle
commit 09b35b4192 upstream.
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: Dave 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: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
482859563c
commit
d08bb3463d
@@ -83,6 +83,7 @@ next:
|
|||||||
ALIGN((uintptr_t)ir, 4)) &&
|
ALIGN((uintptr_t)ir, 4)) &&
|
||||||
(ir < limit) && (*ir == 0))
|
(ir < limit) && (*ir == 0))
|
||||||
ir++;
|
ir++;
|
||||||
|
if (IS_ALIGNED((uintptr_t)ir, 4)) {
|
||||||
for (; (ir + 4) <= limit; ir += 4) {
|
for (; (ir + 4) <= limit; ir += 4) {
|
||||||
dv = *((u32 *)ir);
|
dv = *((u32 *)ir);
|
||||||
if (dv) {
|
if (dv) {
|
||||||
@@ -96,6 +97,7 @@ next:
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
while (likely(ir < limit) && unlikely(*ir == 0))
|
while (likely(ir < limit) && unlikely(*ir == 0))
|
||||||
ir++;
|
ir++;
|
||||||
|
|||||||
Reference in New Issue
Block a user