]> git.baikalelectronics.ru Git - kernel.git/commitdiff
fbdev: fbmem: Fix logo center image dx issue
authorGuiling Deng <greens9@163.com>
Tue, 28 Jun 2022 16:36:41 +0000 (09:36 -0700)
committerHelge Deller <deller@gmx.de>
Wed, 6 Jul 2022 15:04:47 +0000 (17:04 +0200)
Image.dx gets wrong value because of missing '()'.

If xres == logo->width and n == 1, image.dx = -16.

Signed-off-by: Guiling Deng <greens9@163.com>
Fixes: 4e62259d704c ("fbdev: fbmem: add config option to center the bootup logo")
Cc: stable@vger.kernel.org # v5.0+
Signed-off-by: Helge Deller <deller@gmx.de>
drivers/video/fbdev/core/fbmem.c

index 8afc4538558cd74d9f77bbc0c1a5a1e5922f76bc..ee63b5b47290c6e020e9d0b607a694b8550fd20e 100644 (file)
@@ -511,7 +511,7 @@ static int fb_show_logo_line(struct fb_info *info, int rotate,
 
                while (n && (n * (logo->width + 8) - 8 > xres))
                        --n;
-               image.dx = (xres - n * (logo->width + 8) - 8) / 2;
+               image.dx = (xres - (n * (logo->width + 8) - 8)) / 2;
                image.dy = y ?: (yres - logo->height) / 2;
        } else {
                image.dx = 0;