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>
This commit is contained in:
committed by
Helge Deller
parent
69c9820d40
commit
aad1d99bea
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user