]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
fbdev: viafb: fix typo in hw_bitblt_1 and hw_bitblt_2
authorAleksandr Burakov <a.burakov@rosalinux.ru>
Fri, 1 Mar 2024 11:35:43 +0000 (14:35 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 13 Apr 2024 10:50:16 +0000 (12:50 +0200)
[ Upstream commit bc87bb342f106a0402186bcb588fcbe945dced4b ]

There are some actions with value 'tmp' but 'dst_addr' is checked instead.
It is obvious that a copy-paste error was made here and the value
of variable 'tmp' should be checked here.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Aleksandr Burakov <a.burakov@rosalinux.ru>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/video/fbdev/via/accel.c

index eb3615c69987e2db6f4f709b015cee975bdabddd..f542b01568df9b44bcee893723f8a9aca5828b13 100644 (file)
@@ -129,7 +129,7 @@ static int hw_bitblt_1(void __iomem *engine, u8 op, u32 width, u32 height,
 
        if (op != VIA_BITBLT_FILL) {
                tmp = src_mem ? 0 : src_addr;
-               if (dst_addr & 0xE0000007) {
+               if (tmp & 0xE0000007) {
                        printk(KERN_WARNING "hw_bitblt_1: Unsupported source "
                                "address %X\n", tmp);
                        return -EINVAL;
@@ -274,7 +274,7 @@ static int hw_bitblt_2(void __iomem *engine, u8 op, u32 width, u32 height,
                writel(tmp, engine + 0x18);
 
                tmp = src_mem ? 0 : src_addr;
-               if (dst_addr & 0xE0000007) {
+               if (tmp & 0xE0000007) {
                        printk(KERN_WARNING "hw_bitblt_2: Unsupported source "
                                "address %X\n", tmp);
                        return -EINVAL;