Skip to contentSkip to conversation

fbdev: fixed typo in hw_bitblt_1 and hw_bitblt_2

PATCH Applied Aleksandr Burakov 2 participants 2 messages Mar 1, 2024 – Mar 15, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fbdev: fixed typo in hw_bitblt_1 and hw_bitblt_2

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.

Fixes f7018c213502 ("video: move fbdev to drivers/video/fbdev")
---
 drivers/video/fbdev/via/accel.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/video/fbdev/via/accel.c +2 -2
index 0a1bc7a4d785..1e04026f0809 100644
@@ -115,7 +115,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;
@@ -260,7 +260,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;
Signature · 1 line
2.25.1
maintainer Applied
#1 lore raw
Quoted 8 lines · Aleksandr Burakov

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.

Fixes f7018c213502 ("video: move fbdev to drivers/video/fbdev")

applied.
Thanks!
Helge

Quoted 26 lines
---
  drivers/video/fbdev/via/accel.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/video/fbdev/via/accel.c +2 -2
index 0a1bc7a4d785..1e04026f0809 100644
@@ -115,7 +115,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;
@@ -260,7 +260,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;