Commit fea6f330cdd18f79d50bcdfbedb96d929a173e0d

Authored by Dan Carpenter
Committed by Dave Airlie
1 parent dfe63bb0ad

vga_switcheroo: comparing too few characters in strncmp()

This is a copy-and-paste bug.  We should be comparing 4 characters here
instead of 3.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>

Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff

drivers/gpu/vga/vga_switcheroo.c
... ... @@ -346,11 +346,11 @@
346 346 if (strncmp(usercmd, "DIS", 3) == 0)
347 347 client_id = VGA_SWITCHEROO_DIS;
348 348  
349   - if (strncmp(usercmd, "MIGD", 3) == 0) {
  349 + if (strncmp(usercmd, "MIGD", 4) == 0) {
350 350 just_mux = true;
351 351 client_id = VGA_SWITCHEROO_IGD;
352 352 }
353   - if (strncmp(usercmd, "MDIS", 3) == 0) {
  353 + if (strncmp(usercmd, "MDIS", 4) == 0) {
354 354 just_mux = true;
355 355 client_id = VGA_SWITCHEROO_DIS;
356 356 }