fbdev: nvidiafb: Correct const string length in nvidiafb_setup()
authorZijun Hu <quic_zijuhu@quicinc.com>
Mon, 7 Apr 2025 11:55:20 +0000 (19:55 +0800)
committerHelge Deller <deller@gmx.de>
Sat, 31 May 2025 08:24:01 +0000 (10:24 +0200)
The actual length of const string "noaccel" is 7, but the strncmp()
branch in nvidiafb_setup() wrongly hard codes it as 6.

Fix by using actual length 7 as argument of the strncmp().

Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
Signed-off-by: Helge Deller <deller@gmx.de>
drivers/video/fbdev/nvidia/nvidia.c

index 8900f181f1952acd2acc16a6ab49a5a42ec056ac..cfaf9454014d8161bedc3598fb68855e04ea9408 100644 (file)
@@ -1484,7 +1484,7 @@ static int nvidiafb_setup(char *options)
                        flatpanel = 1;
                } else if (!strncmp(this_opt, "hwcur", 5)) {
                        hwcur = 1;
-               } else if (!strncmp(this_opt, "noaccel", 6)) {
+               } else if (!strncmp(this_opt, "noaccel", 7)) {
                        noaccel = 1;
                } else if (!strncmp(this_opt, "noscale", 7)) {
                        noscale = 1;