Commit 2cc9116c authored by Kyle McMartin's avatar Kyle McMartin Committed by Dave Airlie

vgaarb: fix "target=default" passing

Commit 77c1ff39 fixed the userspace
pointer dereference, but introduced another bug pointed out by Eugene Teo
in RH bug #564264. Instead of comparing the point we were at in the string,
we instead compared the beginning of the string to "default".
Signed-off-by: default avatarKyle McMartin <kyle@redhat.com>
Reported-by: default avatarEugene Teo <eteo@redhat.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 6b158352
......@@ -961,7 +961,7 @@ static ssize_t vga_arb_write(struct file *file, const char __user * buf,
remaining -= 7;
pr_devel("client 0x%p called 'target'\n", priv);
/* if target is default */
if (!strncmp(kbuf, "default", 7))
if (!strncmp(curr_pos, "default", 7))
pdev = pci_dev_get(vga_default_device());
else {
if (!vga_pci_str_to_vars(curr_pos, remaining,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment