Skip to content

Commit aad1d99

Browse files
soci64hdeller
authored andcommitted
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: Zsolt Kajtar <soci@c64.rulez.org> Signed-off-by: Helge Deller <deller@gmx.de>
1 parent 69c9820 commit aad1d99

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/video/fbdev/core/fb_fillrect.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ static unsigned long pixel_to_pat(int bpp, u32 color)
9292
pattern = pattern | pattern << bpp;
9393
break;
9494
default:
95-
pattern = color;
96-
break;
95+
return color;
9796
}
9897
#ifndef __LITTLE_ENDIAN
9998
pattern <<= (BITS_PER_LONG % bpp);

0 commit comments

Comments
 (0)