Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fea6f330 authored by Dan Carpenter's avatar Dan Carpenter Committed by Dave Airlie
Browse files

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: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent dfe63bb0
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -346,11 +346,11 @@ vga_switcheroo_debugfs_write(struct file *filp, const char __user *ubuf,
	if (strncmp(usercmd, "DIS", 3) == 0)
		client_id = VGA_SWITCHEROO_DIS;

	if (strncmp(usercmd, "MIGD", 3) == 0) {
	if (strncmp(usercmd, "MIGD", 4) == 0) {
		just_mux = true;
		client_id = VGA_SWITCHEROO_IGD;
	}
	if (strncmp(usercmd, "MDIS", 3) == 0) {
	if (strncmp(usercmd, "MDIS", 4) == 0) {
		just_mux = true;
		client_id = VGA_SWITCHEROO_DIS;
	}