Commit aad1d99b authored by Zsolt Kajtar's avatar Zsolt Kajtar Committed by Helge Deller
Browse files

fbdev: core: Fix ubsan warning in pixel_to_pat



It could be triggered on 32 bit big endian machines at 32 bpp in the
pattern realignment. In this case just return early as the result is
an identity.

Signed-off-by: default avatarZsolt Kajtar <soci@c64.rulez.org>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
parent 69c9820d
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -92,8 +92,7 @@ static unsigned long pixel_to_pat(int bpp, u32 color)
		pattern = pattern | pattern << bpp;
		break;
	default:
		pattern = color;
		break;
		return color;
	}
#ifndef __LITTLE_ENDIAN
	pattern <<= (BITS_PER_LONG % bpp);