diff options
| author | Zsolt Kajtar <soci@c64.rulez.org> | 2025-08-21 04:42:48 +0200 |
|---|---|---|
| committer | Helge Deller <deller@gmx.de> | 2025-09-30 23:21:34 +0200 |
| commit | aad1d99beaaf132e2024a52727c24894cdf9474a (patch) | |
| tree | 17878b76a3cc346b5547dfce61278b2e66c5914f | |
| parent | 69c9820d40892f7c10db03c5364795f5bb12aced (diff) | |
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>
| -rw-r--r-- | drivers/video/fbdev/core/fb_fillrect.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/video/fbdev/core/fb_fillrect.h b/drivers/video/fbdev/core/fb_fillrect.h index 66042e534de7..f366670a53af 100644 --- a/drivers/video/fbdev/core/fb_fillrect.h +++ b/drivers/video/fbdev/core/fb_fillrect.h @@ -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); |
